forked from next-step/java-baseball-playground
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathView.java
More file actions
39 lines (32 loc) · 988 Bytes
/
View.java
File metadata and controls
39 lines (32 loc) · 988 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
package view;
import util.CompareAnswer;
import java.util.Scanner;
import static util.Constant.*;
/**
* 화면출력용 클래스
*/
public class View {
public static void printStart() {
System.out.println(GAME_START_MESSAGE);
}
public void printResult(CompareAnswer answer) {
if (answer.getStrikeCount()>STRIKE_BALL_MIN) {
System.out.printf("%d스트라이크 ",answer.getStrikeCount());
}
if (answer.getBallCount()>STRIKE_BALL_MIN) {
System.out.printf("%d볼 ",answer.getBallCount());
}
if (answer.getNothing()== NOTHING) {
System.out.print("낫싱");
}
System.out.println("");
}
public static void printEnding() {
System.out.println(ALL_NUMBER_CORRECT_MESSAGE);
System.out.println(CONTINUE_GAME_QUESTION);
}
public static boolean isContinue() {
Scanner sc = new Scanner(System.in);
return sc.nextInt() == 1;
}
}