[π μ¬μ΄ν΄2 - λ―Έμ (λΈλμ κ²μ μ€ν)] νΌλ Έ λ―Έμ μ μΆν©λλ€.#1110
[π μ¬μ΄ν΄2 - λ―Έμ
(λΈλμ κ²μ μ€ν)] νΌλ
Έ λ―Έμ
μ μΆν©λλ€.#1110haechanmoon wants to merge 64 commits intowoowacourse:haechanmoonfrom
Conversation
Arachneee
left a comment
There was a problem hiding this comment.
μλ νμΈμ νΌλ Έ~
2λ¨κ³ λ―Έμ νλλΌ κ³ μνμ ¨μ΄μ!
λ―Έμ μꡬμ¬ν λ€μ νμΈν΄μ£ΌμΈμ! BLACK_JACKμΌλ‘ μ΄κΈ°λ μΌμ΄μ€κ° μλ€μ
| int finalIncomeMoney = gambler.calculateFinalIncome(dealer); | ||
| gamblersResult.put(name, finalIncomeMoney); | ||
| } | ||
| return gamblersResult; | ||
| } | ||
|
|
||
| public int dealerFinalIncome(Dealer dealer) { | ||
| int dealerFinalIncome = 0; | ||
| for (Gambler gambler : gamblers) { | ||
| MatchResult result = gambler.getResult(dealer); | ||
| if (result == MatchResult.WIN) { | ||
| loseCount++; | ||
| } | ||
| if (result == MatchResult.LOSE) { | ||
| winCount++; | ||
| } | ||
| logs.add(gambler.showResult(result)); | ||
| dealerFinalIncome += gambler.calculateFinalIncome(dealer); |
There was a problem hiding this comment.
gambler.calculateFinalIncome(dealer) λ₯Ό μ€λ³΅μΌλ‘ κ³μ°ν΄μΌνλ κ² λΉν¨μ¨μ μΈ κ² κ°μμ.
Gamblersκ° κΌ μ΅μ’ λ°°ν κ²°κ³ΌκΉμ§ κ³μ°ν΄μΌν κΉμ? getterλ₯Ό μμ°κΈ° μν΄ μ΄λ° λ©μλλ₯Ό λ§λ κ² κ°μμ.
Gamblersλ μ΄λ€ κΈ°λ₯κΉμ§ μ 곡νλ κ²μ΄ μ’μκΉ? λ₯Ό κ³ λ―Όν΄λ³΄λ©΄ μ’μ κ² κ°μμ.
getterλ μμ»μ§λ§ μ€νλ € Gamblersμ Dealerμ μμ‘΄μ±μ΄ μκΈ°κ³ λ°°ν κ²°κ³ΌκΉμ§ κ³μ°νλ©΄μ μ± μμ΄ λ 컀μ‘μ΄μ.
| public class BettingMoney { | ||
| private final int money; |
There was a problem hiding this comment.
BettingMoneyλ₯Ό μμκ° ν¬μ₯νκ΅°μ π
BettingMoneyκ° VO λλ €λ©΄ μ΄λ€ μ‘°κ±΄μ΄ νμν κΉμ?
| return name; | ||
| } | ||
|
|
||
| public int calculateIncome(BettingMoney bettingMoney) { |
There was a problem hiding this comment.
μ μ ν λ©μλλ€μ! π
| return PlayerNameParser.splitNames(InputView.readLine()); | ||
| } | ||
|
|
||
| private List<Gambler> createGambler() { |
There was a problem hiding this comment.
GamblersκΉμ§ λ§λ€μ΄λ μ’μ κ² κ°μμ!
| @ParameterizedTest | ||
| @ValueSource(ints = {999, 0, -999, -2000}) | ||
| @DisplayName("1000 λ―Έλ§ μ«μ μ λ ₯ μ μ€λ₯λ°μ") |
| WIN("μΉ"), | ||
| LOSE("ν¨"), | ||
| DRAW("무"); | ||
| BLACKJACK("λΈλμ", 1.5), |
There was a problem hiding this comment.
BLACKJACKμΌλ‘ μ΄κΈ°λ κ²½μ°κ° μμ΄μ~
μ²΄ν¬ λ¦¬μ€νΈ
testλ₯Ό μ€ννμ λ, λͺ¨λ ν μ€νΈκ° μ μμ μΌλ‘ ν΅κ³Όνλμ?μ΄λ€ λΆλΆμ μ§μ€νμ¬ λ¦¬λ·°ν΄μΌ ν κΉμ?
μλ νμΈμ! νΌλ Έμ λλ€. λλ²μ§Έ μ¬μ΄ν΄ κΈ°λ₯ ꡬν μλ£νμ΅λλ€.! μ κ° μ¬μ΄ν΄1μ λ°°ν κΈ°λ₯μ μΆκ°νλ©΄μ κ΅μ₯ν λ§μ μ½λλ€μ μμ ν΄μΌ νμ΅λλ€. μ κ° μ½λλ₯Ό μμ νλ©΄μ κ°μ₯ λ§μ΄ λ€μλ μκ°μ λ³κ²½ μ©μ΄ν μ½λ μ λλ€! μꡬμ¬νμ΄ λ°λμμ λ μ΄λ»κ² νλ©΄ λ³κ²½ μ©μ΄ν μ½λλ₯Ό μμ±ν μ μμμ§ κ³ λ―Όμ νμ΅λλ€. μ²μλΆν° λ³κ²½ μ©μ΄ν μ½λλ₯Ό μμ±νλλΌλ©΄ λ§μ μμ μ νμ§ μμμ΄λ λμ κ² κ°μ΅λλ€.
리뷰 μ λΆνλλ¦¬κ² μ΅λλ€!