Skip to content

Conversation

minsang0850
Copy link

No description provided.

Copy link

@joswlv joswlv left a comment

Choose a reason for hiding this comment

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

안녕하세요 민상님!
몇 가지 코멘트를 남겼습니다.
확인 부탁드립니다.

import blackjack.domain.report.GameResult;
import blackjack.domain.report.GameReport;

public class Dealer extends Player {
Copy link

Choose a reason for hiding this comment

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

딜러와 참가자의 공통 속성을 추상화하는 방향으로 수정해보는 것은 어떨까요?
참고 자료
https://tecoble.techcourse.co.kr/post/2020-05-18-inheritance-vs-composition/

}

public List<Card> getCards() {
return Collections.unmodifiableList(cards);
Copy link

Choose a reason for hiding this comment

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

Suggested change
return Collections.unmodifiableList(cards);
return new ArrayList<>cards);

Collections.unmodifiableList는 방어적 복사가 되지 않습니다.

참고 자료

Set<Card> removeDuplicates = new HashSet<>(cards);
assertThat(removeDuplicates.size()).isEqualTo(52);
}
} No newline at end of file
Copy link

Choose a reason for hiding this comment

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

파일 마지막은 개행을 해주는 것이 컨벤션입니다.
https://blog.coderifleman.com/2015/04/04/text-files-end-with-a-newline/


import java.util.Objects;

public class Card {
Copy link

Choose a reason for hiding this comment

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

Card를 static하게 만들어 보는 것은 어떨까요?
이전 로또미션의 로또넘버 객체와 같은 원리 입니다.

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.

3 participants