File tree Expand file tree Collapse file tree 2 files changed +3
-4
lines changed
number-baseball/src/main/java/io/github/gunkim/baseball/domain Expand file tree Collapse file tree 2 files changed +3
-4
lines changed Original file line number Diff line number Diff line change 11package io .github .gunkim .baseball .domain ;
22
33public class BaseBallGame {
4-
54 private final Input userInput ;
65 private final Input computerInput ;
76 private final Output output ;
@@ -30,7 +29,7 @@ public void start() {
3029 }
3130
3231 private boolean checkGameEnd (final Result result ) {
33- if (result .isAllStrike ()) {
32+ if (result .isAllStrike (totalBallCount )) {
3433 output .gameEndedMessage (totalBallCount );
3534 return true ;
3635 }
Original file line number Diff line number Diff line change @@ -4,8 +4,8 @@ public record Result(
44 int strike ,
55 int ball
66) {
7- public boolean isAllStrike () {
8- return ball == 0 && strike > 0 ;
7+ public boolean isAllStrike (final int totalBallCount ) {
8+ return strike == totalBallCount ;
99 }
1010
1111 public boolean isNothing () {
You can’t perform that action at this time.
0 commit comments