-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBoardSetupView.java
More file actions
111 lines (96 loc) · 2.84 KB
/
BoardSetupView.java
File metadata and controls
111 lines (96 loc) · 2.84 KB
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
package cs3500.pa03.View;
/**
* Represents the board setup view
* just prints everything
*/
public class BoardSetupView {
private Readable rd;
private Appendable ap;
/**
* Prints the welcome message.
*/
public void printWelcomeMessage() {
System.out.println("Hello! Welcome to the OOD BattleSalvo Game! ");
}
/**
* Prints the dimensions message.
*/
public void printDimensionsMessage() {
System.out.println("Please enter a valid height and width below: ");
}
/**
* Prints the line.
*/
public void printLine() {
System.out.println("------------------------------------------------------");
}
/**
* Prints the invalid dimensions message.
*/
public void printInvalidDimensions() {
System.out.println("Uh Oh! You've entered invalid dimensions. "
+ "Please remember that the height and width\nof the game must be in the range (6, 15), "
+ "inclusive. Try again! ");
}
/**
* @param maxShips - the max number of ships
*/
public void printFleetMessage(int maxShips) {
System.out.println("Please enter your fleet in the order "
+ "[Carrier, Battleship, Destroyer, Submarine].\n"
+ "Remember, your fleet may not exceed size " + maxShips + ".");
}
/**
* @param maxShips - the max number of ships
*/
public void printInvalidFleetMessage(int maxShips) {
System.out.println("Uh Oh! You've entered invalid fleet sizes.\n"
+ "Please enter your fleet in the order [Carrier, Battleship, Destroyer, Submarine].\n"
+ "Remember, your fleet may not exceed size " + maxShips + ".");
}
/**
* @param maxShots - maximum shots allowed
*/
public void printTakeShots(int maxShots) {
System.out.println("Please enter + " + maxShots + " Shots (Ex: x y): ");
}
/**
* @param maxShots - maximum shots allowed
*/
public void printInvalidShots(int maxShots) {
System.out.println("Uh Oh! You've entered invalid shots.\n"
+ "Please enter + " + maxShots + " Shots: ");
}
/**
* @param x - x coordinate
* @param y - y coordinate
*/
public void printAiShots(int x, int y) {
System.out.println("AI got hit at point: (" + x + ", " + y + ")");
}
/**
* @param x - x coordinate
* @param y - y coordinate
*/
public void printHumanShots(int x, int y) {
System.out.println("You got hit at point: (" + x + ", " + y + ")");
}
/**
* Prints the user winner message.
*/
public void printUserWinner() {
System.out.println("Congratulations! You won!");
}
/**
* Prints the user loser message.
*/
public void printLoser() {
System.out.println("Sorry! You lost!");
}
/**
* Prints the tie message.
*/
public void printTie() {
System.out.println("It's a tie!");
}
}