-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathConnect4View.java
50 lines (43 loc) · 1.28 KB
/
Connect4View.java
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
/**
* View for Connect 4 game (in model-view-controller pattern)
* Displays the game and interacts with the user
* @author Scot Drysdale
*/
public interface Connect4View {
/**
* Displays the current board
* @param state current state of the game
*/
public void display (Connect4State state);
/**
* Asks the user for a move
* The move will be in the range 0 to Connect4State.COLS-1.
* @param state current state of the game
* @return the number of the move that player chose
*/
public int getUserMove(Connect4State state);
/**
* Reports the move that a player has made.
* The move should be in the range 0 to Connect4State.COLS-1.
* @param chosenMove the move to be reported
* @param name the player's name
*/
public void reportMove (int chosenMove, String name);
/**
* Ask the user the question and return the answer as an int
* @param question the question to ask
* @return The depth the player chose
*/
public int getIntAnswer (String question);
/**
* Convey a message to user
* @param message the message to be reported
*/
public void reportToUser(String message);
/**
* Ask the question and return the answer
* @param question the question to ask
* @return the answer to the question
*/
public String getAnswer(String question);
}