-
Notifications
You must be signed in to change notification settings - Fork 75
[박민상] 연료 주입, 블랙잭 (Step 1) #31
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
base: minsang0850
Are you sure you want to change the base?
Conversation
There was a problem hiding this 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 { |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Card를 static하게 만들어 보는 것은 어떨까요?
이전 로또미션의 로또넘버 객체와 같은 원리 입니다.
No description provided.