49 lines
892 B
Java
49 lines
892 B
Java
|
import java.util.ArrayList;
|
||
|
public class Server {
|
||
|
private String name;
|
||
|
private String path;
|
||
|
private boolean enabled;
|
||
|
private ArrayList<String> playerList;
|
||
|
private ServerType type;
|
||
|
private String serverVersion;
|
||
|
|
||
|
public Server(String name) {
|
||
|
this.name = name;
|
||
|
this.path = "";
|
||
|
this.isEnabled = false;
|
||
|
this.playerList = new ArrayList<String>();
|
||
|
this.type = null;
|
||
|
this.serverVersion = null;
|
||
|
}
|
||
|
|
||
|
public void addPlayer(String name) {
|
||
|
this.playerList.add(name);
|
||
|
}
|
||
|
|
||
|
public void removePlayer(String name) {
|
||
|
for (int i = 0; i < playerList.size(); i++) {
|
||
|
if (name.equals(playerList.get(i))) {
|
||
|
playerList.remove(i);
|
||
|
return;
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
public String getPath() {
|
||
|
return this.path;
|
||
|
}
|
||
|
|
||
|
public ServerType getType() {
|
||
|
return this.type;
|
||
|
}
|
||
|
|
||
|
public String getVersion() {
|
||
|
return this.version;
|
||
|
}
|
||
|
|
||
|
public boolean isEnabled() {
|
||
|
return this.enabled;
|
||
|
}
|
||
|
|
||
|
|
||
|
}
|