Skip to content

Commit f1ba3ac

Browse files
committed
feat: 재시작 입력 오류 시 재시작 입력 재시도 구현
1 parent 5043dda commit f1ba3ac

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

src/main/java/com/kakao/onboarding/precource/dukeyun/baseball/framework/gamesystem/ReplayableGameSystem.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,16 @@ public void run() {
1818
while (replay) {
1919
game.init();
2020
game.play();
21-
replay = systemView.requestReplayInput();
21+
replay = inputReplay();
22+
}
23+
}
24+
25+
private boolean inputReplay() {
26+
try {
27+
return systemView.requestReplayInput();
28+
} catch (IllegalArgumentException e) {
29+
System.out.println("[ERROR] " + e.getMessage());
30+
return inputReplay();
2231
}
2332
}
2433
}

0 commit comments

Comments
 (0)