Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[럿고] 블랙잭 2단계 미션 제출합니다. #93

Merged
merged 28 commits into from
Mar 28, 2020

Conversation

ksy90101
Copy link

후니님! 안녕하세요. 럿고입니다! 1단계 머지 후 남겨주신 피드백과 같이 반영했습니다. 페어코드로 페어 프로그래밍 진행 후 merge를 해서 로직이 변경된 부분도 있습니다! 2단계에서도 부족한 부분 피드백 주시면 감사하겠습니다! 그럼 이번에도 잘 부탁드리겠습니다~

LTTTTTE and others added 22 commits March 15, 2020 17:16
* ADD : 카드 모양을 저장하는 enum 추가

* docs : 기능 요구사항 정리

* ADD : 카드 넘버를 저장하는 enum 추가

* add : Card 정보를 담고 있는 객체 추가

* ADD : 카드를 덱을 만드는 클래스 추가

* [add] 게이머들의 공통 부분 추상 클래스화

* ADD : 딜러가 카드를 더 받을수 있는지 여부 확인하는 기능 추가

* FEAT : 플레이어가 카드를 더 받을 수 있는지 여부 확인하는 기능 추가

* ADD : 플레이어의 카드 점수 더해주는 기능 추가

* feat: Player 일급 컬렉션 생성

* ADD : 플레이어 이름 입력받는 기능 추가

* feat : 컨트롤러 추가 및 이름을 받아 플레이어 생성 기능 추가

* ADD : Gamer 들에게 초반 카드 지급하는 기능 추가

* feat: 플레이어 카드 지급 여부 묻고 카드 지급 기능 구현

* ADD : 딜러의 점수에따라 추가카드 받는 기능

* feat: 카드 결과와 점수 결과를 보여주는 기능 추가

* refactor : 딜러가 추가카드 지급 리팩토링

* [refactor] 카드 숫자 출력 시 이니셜로 변경 리팩토링

* refactor : 점수계산 기능을 Gamer 에게 이동 리팩토링

* refactor : 에이스가 존재할때 각 상황 테스트 추가

* feat : 최종 승패 결과 출력 기능 구현

* refactor : toString 메서드 제거

* refactor: 승패 결과 출력 메서드 다시 추가

* refactor: toString 제거 리팩토링

* refactor : 초기 딜러카드 출력 리팩토링

* refactor : 52장 카드를 생성하는 CardFacotory 리팩토링

* refactor : Gamers 생성자 리팩토링

* refactor: 승패 여부 리팩토링

* refactor : Gamers 초기카드 2장을 주는기능 리팩토링

* refactor : 입력값에 따라 yes 또는 no를 찾는 기능 리팩토링

* test : 게이머들 승패결과 반환하는 기능 테스트

* refactor: 플레이어가 버스트 되었을 경우 리팩토링

* test : 플레이어들 카드 더받을수 있는지 여부 테스트

* refactor : 딜러가 추가 카드를 지급 받는지에 대한 리팩토링

* feat : 무승부 결과 기능 추가

* refactor : 딜러와 플레이어의 승패 결과 리팩토링

* refactor : 전반적인 컨벤션 리팩토링

* refactor: 승패결과를 함수형 인터페이스로 리팩토링

* refactor : 기능, 의미가 맞게 domain 이름수정

- WinOrLose -> MatchResult
- YesOrNo -> Answer

* refactor : 기능, 의미가 맞게 domain 이름수정

- CardFactory -> CardsFactory

* refactor : 메소드 네이밍 수정

* refactor : 기본 컨벤션 수정

* refactor : 딜러가 같은 카드를 뽑는 버그 수정

* refactor : 불필요한 내용 외부에 들어나지 않도록 메소드 이름 수정

Gamer.calculateScore

* refactor : Map<Player, MatchResult> 를 담는 도메인 생성 및 적용

* refactor : 커스텀Exception 클래스 내부에서 메세지를 전달하도록 수정

* refactor : 팩토리메소드 네이밍 규칙 적용

* refactor : 상수 선언 중복제거 및 네이밍 수정

* test : 카드 추가시 중복되는 카드가 들어오는지 확인하는 테스트 추가

Co-authored-by: Seyun <ksy90101@gmail.com>
- 게이머 카드 결과를 저장하는 CardsResult 클래스 추가
- GameResult 에서 딜러의 점수를 반환하는 기능 추가
Copy link

@jeonghoon1107 jeonghoon1107 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

안녕하세요 럿고!
피드백 남겼으니 확인해주세요 :)

}
}

private static class Constants {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

해당 클래스에서만 사용하는 것 같은데 변수로 두면 어떨까요?

Copy link
Author

@ksy90101 ksy90101 Mar 22, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

enum안에서 상수 사용 방법을 몰라서 이렇게 따로 내부 클래스를 생성했는데, 다시 변경하였습니다!

}
}

public GameResult generateGameResults() {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GameResult에 gamers를 넘기면 어떨까요?
player.findMatchResult 해당 메서드도 gameResult가 구하면 객체간의 역할이 조금 더 명확할 것 같아요.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

둘다 말씀하신대로 처리했습니다!

return new Money(-money);
}

public Money getZeroMoney() {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

상수로 두고 사용하면 어떨까요?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

0에 대한 값을 상수 처리하였습니다!

Copy link

@jeonghoon1107 jeonghoon1107 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

안녕하세요 럿고!
컴파일 오류가 나는 부분이 있는데 확인해주세요 :)


public GameResult(Gamers gamers) {
this.gameResult = gamers.getPlayers().stream()
.collect(collectingAndThen(toMap(Player -> Player,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

해당 부분 한번 더 체크해주세요!

import java.util.Objects;

public class Money {
public static final int ZERO_MONEY_VALUE = 0;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

상수로 빼라는 것은 아래와 같은 방식을 말씀드린 것이었어요!
public static final Money ZERO = new Money(0); 이 되면 어떨까요?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

말씀하신대로 구현하였습니다.

Copy link

@jeonghoon1107 jeonghoon1107 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

안녕하세요 럿고!
피드백 반영 잘 해주셨네요 👍
미션 진행하느라 고생하셨습니다 :)

@jeonghoon1107 jeonghoon1107 merged commit c05f65e into woowacourse:ksy90101 Mar 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants