-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGamer.java
More file actions
70 lines (62 loc) · 1.5 KB
/
Gamer.java
File metadata and controls
70 lines (62 loc) · 1.5 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
public class Gamer {
private String name;
private boolean connected;
private String server;
private int port;
/**
* Constructs a new Gamer with the specified name.
* @param name The gamer's name.
*/
public Gamer(String name) {
this.name = name;
}
/**
* Returns the gamer's name.
* @return The name of the gamer.
*/
public String getName() {
return this.name;
}
/**
* Checks if the gamer is connected.
* @return true if connected, false otherwise.
*/
public boolean isConnected() {
return this.connected;
}
/**
* Sets the gamer's connection status.
* @param connected true if connected, false otherwise.
*/
public void setConnected(boolean connected) {
this.connected = connected;
}
/**
* Returns the server the gamer is connected to.
* @return The server name.
*/
public String getServer() {
return this.server;
}
/**
* Sets the server the gamer is connected to.
* @param server The server name.
*/
public void setServer(String server) {
this.server = server;
}
/**
* Returns the port number the gamer is connected on.
* @return The port number.
*/
public int getPort() {
return this.port;
}
/**
* Sets the port number for the gamer's connection.
* @param port The port number.
*/
public void setPort(int port) {
this.port = port;
}
}