Conversation
pci2676
requested changes
Dec 5, 2023
|
|
||
| for (player in players) { | ||
| while (InputView.askPlayer(player.name) && !player.isBusted) { | ||
| while (!player.isBusted && InputView.askPlayer(player.name)) { |
| abstract class BlackjackParticipant(val name: String, var bettingAmount: Int = 0) { | ||
| private var _cards = Cards(mutableListOf()) | ||
|
|
||
| var profit = 0.0 |
Comment on lines
+16
to
+22
| for (resultMap in resultMapList) { | ||
| for ((player, matchResult) in resultMap) { | ||
| val profit = matchResult.rate * player.bettingAmount | ||
| player.profit = profit | ||
| dealer.calculateProfit(profit.toInt()) | ||
| } | ||
| } |
There was a problem hiding this comment.
depth가 2가 넘는것 같습니다.
객체의 값을 외부에서 set할수 없도록 하고 메세지를 던지도록 변경해주시면 좋을것 같습니다.
| package blackjack.domain | ||
|
|
||
| abstract class BlackjackParticipant(val name: String) { | ||
| abstract class BlackjackParticipant(val name: String, var bettingAmount: Int = 0) { |
|
|
||
| for (resultMap in resultMapList) { | ||
| for ((player, matchResult) in resultMap) { | ||
| val profit = matchResult.rate * player.bettingAmount |
There was a problem hiding this comment.
프로퍼티를 get해서 사용하지 말고 메세지를 주고받도록 해주시면 좋을것 같습니다.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
4단계 베팅 기능 추가하였습니다!