-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathViewListener.java
More file actions
36 lines (36 loc) · 1.36 KB
/
ViewListener.java
File metadata and controls
36 lines (36 loc) · 1.36 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
import java.io.IOException;
/**
* The ViewListener interface lays out the methods needed for communication
* from client to server.
*
* @author Pavel Rozvora (pxr8306)
* @version 2015-12-08
*/
public interface ViewListener {
/**
* The join method sends the players name and a model listener to the
* server in order to be placed in a game session.
* @param proxy A reference to the view proxy object for the client
* @param name The player's name
* @throws IOException Thrown when I/O fails or is interrupted
*/
public void join(NimViewProxy proxy, String name) throws IOException;
/**
* This method tells the server what move the player made.
* @param heapId id of heap from which markers were taken
* @param markers how many markers were taken
* @throws IOException Thrown when I/O fails or is interrupted
*/
public void take(int heapId, int markers) throws IOException;
/**
* This method informs the server that a player would like to start a new
* game.
* @throws IOException Thrown when I/O fails or is interrupted
*/
public void newGame() throws IOException;
/**
* This method informs the server that a player has terminated the program.
* @throws IOException Thrown when I/O fails or is interrupted
*/
public void quit() throws IOException;
}