Conversation
Co-authored-by: hochan222 <[email protected]> Co-authored-by: chanuuuuu <[email protected]>
Co-authored-by: hochan222 <[email protected]> Co-authored-by: chanuuuuu <[email protected]>
Co-authored-by: hochan222 <[email protected]> Co-authored-by: chanuuuuu <[email protected]>
Co-authored-by: hochan222 <[email protected]> Co-authored-by: chanuuuuu <[email protected]>
Co-authored-by: hochan222 <[email protected]> Co-authored-by: chanuuuuu <[email protected]>
Co-authored-by: hochan222 <[email protected]> Co-authored-by: chanuuuuu <[email protected]>
Co-authored-by: hochan222 <[email protected]> Co-authored-by: chanuuuuu <[email protected]>
Co-authored-by: hochan222 <[email protected]> Co-authored-by: chanuuuuu <[email protected]>
Co-authored-by: hochan222 <[email protected]> Co-authored-by: chanuuuuu <[email protected]>
Co-authored-by: hochan222 <[email protected]> Co-authored-by: chanuuuuu <[email protected]>
- 거리를 가져야한다. - 거리는 `0` 이상 정수이어야 한다. Co-authored-by: hochan222 <[email protected]> Co-authored-by: chanuuuuu <[email protected]>
- 거리를 가져야한다. - 거리는 `0` 이상 정수이어야 한다. Co-authored-by: hochan222 <[email protected]> Co-authored-by: chanuuuuu <[email protected]>
- 거리를 가져야한다. - 거리는 `0` 이상 정수이어야 한다. Co-authored-by: hochan222 <[email protected]> Co-authored-by: chanuuuuu <[email protected]>
- 거리를 가져야한다. - 거리는 `0` 이상 정수이어야 한다. Co-authored-by: hochan222 <[email protected]> Co-authored-by: chanuuuuu <[email protected]>
Co-authored-by: hochan222 <[email protected]> Co-authored-by: chanuuuuu <[email protected]>
Co-authored-by: hochan222 <[email protected]> Co-authored-by: chanuuuuu <[email protected]>
Co-authored-by: hochan222 <[email protected]> Co-authored-by: chanuuuuu <[email protected]>
Co-authored-by: hochan222 <[email protected]> Co-authored-by: chanuuuuu <[email protected]>
- Avante - `Avante` String Type 이름을 가져야한다. - `15km/리터`의 연비 가져야한다. - 거리 가져야한다. - 거리는 `0` 이상 정수이어야한다. - - 주입해야할 연료량을 구할 수 있다. Co-authored-by: hochan222 <[email protected]> Co-authored-by: chanuuuuu <[email protected]>
- Avante - `Avante` String Type 이름을 가져야한다. - `15km/리터`의 연비 가져야한다. - 거리 가져야한다. - 거리는 `0` 이상 정수이어야한다. - - 주입해야할 연료량을 구할 수 있다. Co-authored-by: hochan222 <[email protected]> Co-authored-by: chanuuuuu <[email protected]>
- Avante - `Avante` String Type 이름을 가져야한다. - `15km/리터`의 연비 가져야한다. - 거리 가져야한다. - 거리는 `0` 이상 정수이어야한다. - - 주입해야할 연료량을 구할 수 있다. Co-authored-by: hochan222 <[email protected]> Co-authored-by: chanuuuuu <[email protected]>
- K5
- `K5` String Type 이름을 가져야한다.
- `13km/리터`의 연비 가져야한다.
- 거리 가져야한다.
- 거리는 `0` 이상 정수이어야한다.
- 주입해야할 연료량을 구할 수 있다.
Co-authored-by: hochan222 <[email protected]>
Co-authored-by: chanuuuuu <[email protected]>
- K5
- `K5` String Type 이름을 가져야한다.
- `13km/리터`의 연비 가져야한다.
- 거리 가져야한다.
- 거리는 `0` 이상 정수이어야한다.
- 주입해야할 연료량을 구할 수 있다.
Co-authored-by: hochan222 <[email protected]>
Co-authored-by: chanuuuuu <[email protected]>
- K5
- `K5` String Type 이름을 가져야한다.
- `13km/리터`의 연비 가져야한다.
- 거리 가져야한다.
- 거리는 `0` 이상 정수이어야한다.
- 주입해야할 연료량을 구할 수 있다.
Co-authored-by: hochan222 <[email protected]>
Co-authored-by: chanuuuuu <[email protected]>
Co-authored-by: hochan222 <[email protected]> Co-authored-by: chanuuuuu <[email protected]>
Co-authored-by: hochan222 <[email protected]> Co-authored-by: chanuuuuu <[email protected]>
변경된 클래스 - Avante - K5 Co-authored-by: hochan222 <[email protected]> Co-authored-by: chanuuuuu <[email protected]>
Co-authored-by: hochan222 <[email protected]> Co-authored-by: chanuuuuu <[email protected]>
Co-authored-by: hochan222 <[email protected]> Co-authored-by: chanuuuuu <[email protected]>
Co-authored-by: hochan222 <[email protected]> Co-authored-by: chanuuuuu <[email protected]>
- Deck을 가지고 있다. - UserName을 가지고 있다. - name은 `dealer`라는 기본 이름을 가진다. Co-authored-by: hochan222 <[email protected]> Co-authored-by: chanuuuuu <[email protected]>
Co-authored-by: hochan222 <[email protected]> Co-authored-by: chanuuuuu <[email protected]>
- GameUser - BlackJack을 수행하는 User의 집합 - List<User>를 가지고 있다. - User를 추가할 수 있다. - List<User>를 반환할 수 있다. Co-authored-by: hochan222 <[email protected]> Co-authored-by: chanuuuuu <[email protected]>
- GameUser - BlackJack을 수행하는 User의 집합 - List<User>를 가지고 있다. - User를 추가할 수 있다. - List<User>를 반환할 수 있다. Co-authored-by: hochan222 <[email protected]> Co-authored-by: chanuuuuu <[email protected]>
- GameUser - BlackJack을 수행하는 User의 집합 - List<User>를 가지고 있다. - User를 추가할 수 있다. - List<User>를 반환할 수 있다. Co-authored-by: hochan222 <[email protected]> Co-authored-by: chanuuuuu <[email protected]>
- GameUser 인스턴스 생성방식 변경 Co-authored-by: hochan222 <[email protected]> Co-authored-by: chanuuuuu <[email protected]>
Co-authored-by: hochan222 <[email protected]> Co-authored-by: chanuuuuu <[email protected]>
Co-authored-by: hochan222 <[email protected]> Co-authored-by: chanuuuuu <[email protected]>
- GameUser를 가지고 있다. - GameCard를 가지고 있다. - 게임 진행시 최초로 GameCard를 셔플할 수 있다. Co-authored-by: hochan222 <[email protected]> Co-authored-by: chanuuuuu <[email protected]>
- 게임 진행시 최초로 GameCard를 셔플할 수 있다. - User별로 초기 카드를 나눠준다. - GameCard에서 Card를 두 장 뽑기 - User에게 Card 전달하기 Co-authored-by: hochan222 <[email protected]> Co-authored-by: chanuuuuu <[email protected]>
- 게임 진행시 최초로 GameCard를 셔플할 수 있다. - User별로 초기 카드를 나눠준다. - GameCard에서 Card를 두 장 뽑기 - User에게 Card 전달하기 Co-authored-by: hochan222 <[email protected]> Co-authored-by: chanuuuuu <[email protected]>
- 게임 진행시 최초로 GameCard를 셔플할 수 있다. - User별로 초기 카드를 나눠준다. - GameCard에서 Card를 두 장 뽑기 - User에게 Card 전달하기 Co-authored-by: hochan222 <[email protected]> Co-authored-by: chanuuuuu <[email protected]>
Co-authored-by: hochan222 <[email protected]> Co-authored-by: chanuuuuu <[email protected]>
Co-authored-by: hochan222 <[email protected]> Co-authored-by: chanuuuuu <[email protected]>
- BlackJack - 게임 로직 수행
- GameUser를 가지고 있다.
- GameCard를 가지고 있다.
- 게임 진행시 최초로 GameCard를 셔플할 수 있다.
- User별로 초기 카드를 나눠준다.
- GameCard에서 Card를 두 장 뽑기
- User에게 Card 전달하기
- Dealer는 총 score가 16이하일 경우, 1장의 카드를 추가로 받는다.
- User별로 턴을 진행할 수 있게 한다.
- GameCard에서 Card를 한 장 뽑기
- User에게 Card 전달하기
- Player는 총 score가 21이하일 경우, 1장의 카드를 추가로 받을 수 있다.
Co-authored-by: hochan222 <[email protected]>
Co-authored-by: chanuuuuu <[email protected]>
- BlackJack - 게임 로직 수행
- GameUser를 가지고 있다.
- GameCard를 가지고 있다.
- 게임 진행시 최초로 GameCard를 셔플할 수 있다.
- User별로 초기 카드를 나눠준다.
- GameCard에서 Card를 두 장 뽑기
- User에게 Card 전달하기
- Dealer는 총 score가 16이하일 경우, 1장의 카드를 추가로 받는다.
- User별로 턴을 진행할 수 있게 한다.
- GameCard에서 Card를 한 장 뽑기
- User에게 Card 전달하기
- Player는 총 score가 21이하일 경우, 1장의 카드를 추가로 받을 수 있다.
Co-authored-by: hochan222 <[email protected]>
Co-authored-by: chanuuuuu <[email protected]>
Co-authored-by: hochan222 <[email protected]> Co-authored-by: chanuuuuu <[email protected]>
Co-authored-by: hochan222 <[email protected]> Co-authored-by: chanuuuuu <[email protected]>
Co-authored-by: hochan222 <[email protected]> Co-authored-by: chanuuuuu <[email protected]>
- UserStats - User별 승/패에 대한 정보 - GameUser를 인자로 받아 User별, 승/패 정보를 계산한다. Co-authored-by: hochan222 <[email protected]> Co-authored-by: chanuuuuu <[email protected]>
- UserStats - User별 승/패에 대한 정보 - GameUser를 인자로 받아 User별, 승/패 정보를 계산한다. Co-authored-by: hochan222 <[email protected]> Co-authored-by: chanuuuuu <[email protected]>
- UserStats - User별 승/패에 대한 정보 - GameUser를 인자로 받아 User별, 승/패 정보를 계산한다. Co-authored-by: hochan222 <[email protected]> Co-authored-by: chanuuuuu <[email protected]>
- UserStats - User별 승/패에 대한 정보 - GameUser를 인자로 받아 User별, 승/패 정보를 계산한다. Co-authored-by: hochan222 <[email protected]> Co-authored-by: chanuuuuu <[email protected]>
- UserStats - User별 승/패에 대한 정보
- GameUser를 인자로 받아 User별, 승/패 정보를 계산한다.
- User별 Deck의 score를 출력하기 위한 String을 반환할 수 있다. convertTotalScore()
- User별 최종 승/패를 출력하기 위한 String을 반환할 수 있다. convertTotalResult()
- User별 Deck의 score가 21을 초과할 경우, 승/패를 계산할 수 있다.
- Dealer의 score가 21을 초과할 경우, Player가 승리한다.
- Dealer의 score가 21을 초과하지 않고, Player의 score가 21을 초과하는 경우, Dealer가 승리한다.
Co-authored-by: hochan222 <[email protected]>
Co-authored-by: chanuuuuu <[email protected]>
Co-authored-by: hochan222 <[email protected]> Co-authored-by: chanuuuuu <[email protected]>
Co-authored-by: hochan222 <[email protected]> Co-authored-by: chanuuuuu <[email protected]>
Co-authored-by: hochan222 <[email protected]> Co-authored-by: chanuuuuu <[email protected]>
Co-authored-by: hochan222 <[email protected]> Co-authored-by: chanuuuuu <[email protected]>
Co-authored-by: hochan222 <[email protected]> Co-authored-by: chanuuuuu <[email protected]>
liquidjoo
left a comment
There was a problem hiding this comment.
안녕하세요 이번 블랙잭 리뷰어를 맡은 김성주 입니다
미션 구현 잘해주셨어요 👍
몇 가지 코멘트 남겼어요 확인하고 다시 요청 주세요 🙇
| public static Game getInstance() { | ||
| if (game == null) { | ||
| game = new Game(getPlayerName()); | ||
| } | ||
| return game; | ||
| } | ||
|
|
There was a problem hiding this comment.
싱글톤 패턴을 사용하신 이유가 있을까요?
싱글톤 패턴에는 장단점이 있는데요~ 한번 알아보는 것도 좋을 것 같네요
| private void init() { | ||
| blackJack.initCardDraw(); | ||
| OutputView.printInitCardDrawFormat(blackJack.getGameUser().convertPlayersName()); | ||
| OutputView.printUserStatus(blackJack.getGameUser()); | ||
| } |
There was a problem hiding this comment.
블랙잭을 초기화 하는 도메인 로직과 화면 로직이 같이 있어서 테스트하기가 너무 어려울 것 같아요
도메인 로직과 화면을 분리해 테스트 할 수 있도록 작성해보는 것이 어떨까요?
| private void summarize() { | ||
| UserStats userStats = UserStats.of(blackJack.getGameUser()); | ||
| OutputView.printTotalScore(userStats.convertTotalScore()); | ||
| OutputView.printTotalResult(userStats.convertTotalResult()); | ||
| } |
| import blackJack.view.OutputView; | ||
| import java.util.List; | ||
|
|
||
| public class Game { |
| private void cardShuffle() { | ||
| gameCard.shuffle(); | ||
| } |
There was a problem hiding this comment.
랜덤적인 요소가 있는 메서드를 어떻게 테스트를 진행해 볼 수 있을까요?
| public GameUser append(Player user) { | ||
| players.add(user); | ||
| return this; | ||
| } |
There was a problem hiding this comment.
다른 곳에서 사용하지 않는다면 접근 제어자를 활용해보는 것이 어떨까요?
| return this; | ||
| } | ||
|
|
||
| public List<User> getUsers() { |
| } | ||
|
|
||
| public List<User> getUsers() { | ||
| List<User> user = new ArrayList<>(); |
| .isInstanceOf(RuntimeException.class); | ||
|
|
||
| } | ||
| } No newline at end of file |
There was a problem hiding this comment.
파일 마지막에 엔터(개행문자)를 넣어주세요!!
이유는 리뷰를 진행할 때 깃허브에서 경고메시지를 지우기 위함입니다.
좀 더 알고 싶으시면 재미삼아 아래의 링크를 보시는 것도 추천 드립니다.
https://minz.dev/19
Intellij 를 사용하실 경우엔
Preferences -> Editor -> General -> Ensure line feed at file end on save 를 체크해주시면
파일 저장 시 마지막에 개행문자를 자동으로 넣어줍니다!
| @DisplayName("카드 숫자와 카드 타입을 입력할때, 주어진 숫자와 타입으로 카드가 생성된다.") | ||
| @ParameterizedTest | ||
| @MethodSource("generateCardTypeAndCardNumber") | ||
| void givenNumberWithStringAndTypeWithString_WhenGetCardNumberAndGetCardType_ThenEqualToGivenNumberAndType( |
There was a problem hiding this comment.
이름이 너무 긴 것 같아요~
카드_숫자와_카드_타입을_입력할때_주어진_숫자와_타입으로_카드가_생성된다와 같이 한글로 메서드 명을 적어도 괜찮아요~
안녕하세요.
리뷰 주셔서 감사드립니다.
Step1 @chanuuuuu 님과 페어로 진행했습니다.
좋은 하루 보내세요 :)