-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathNetworkGame.java
82 lines (72 loc) · 1.67 KB
/
NetworkGame.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
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
public interface NetworkGame {
/**
* Returns the playerID (index) of the local player.
*
* @return the playerID (index) of the local player
*/
public int getPlayerID();
/**
* Sets the playerID (index) of the local player.
*
* @param playerID
* the playerID (index) of the local player.
*/
public void setPlayerID(int playerID);
/**
* Returns the name of the local player.
*
* @return the name of the local player
*/
public String getPlayerName();
/**
* Sets the name of the local player.
*
* @param playerName
* the name of the local player
*/
public void setPlayerName(String playerName);
/**
* Returns the IP address of the server.
*
* @return the IP address of the server
*/
public String getServerIP();
/**
* Sets the IP address of the server.
*
* @param serverIP
* the IP address of the server
*/
public void setServerIP(String serverIP);
/**
* Returns the TCP port of the server.
*
* @return the TCP port of the server
*/
public int getServerPort();
/**
* Sets the TCP port of the server
*
* @param serverPort
* the TCP port of the server
*/
public void setServerPort(int serverPort);
/**
* Makes a network connection to the server.
*/
public void connect();
/**
* Parses the specified message received from the server.
*
* @param message
* the specified message received from the server
*/
public void parseMessage(GameMessage message);
/**
* Sends the specified message to the server.
*
* @param message
* the specified message to be sent the server
*/
public void sendMessage(GameMessage message);
}