Legger til manglende kommentarer for RoboRallyServer

This commit is contained in:
Kristian Knarvik 2020-04-17 12:57:56 +02:00
parent f8fdc64553
commit 59a63a7ab8

View File

@ -28,6 +28,10 @@ public class RoboRallyServer {
server.addListener(listener);
}
/**
* Makes notice of players which are dead and as such should not be expected to send anything
* @param deadRobotList A list of robot ids of robots which are permanently dead
*/
public void setDeadPlayers(List<RobotID> deadRobotList) {
listener.setDeadPlayers(deadRobotList);
}
@ -47,6 +51,7 @@ public class RoboRallyServer {
public Map<Connection, String> getPlayerNames() {
return listener.getPlayerNames();
}
/**
* Sends an object to all clients
* @param object The object to send
@ -55,8 +60,13 @@ public class RoboRallyServer {
server.sendToAllTCP(object);
}
public void sendToClient(Connection connection, Object object){
server.sendToTCP(connection.getID(),object);
/**
* Sends an object to a specific client
* @param connection The connection to send the object to
* @param object The object to send
*/
public void sendToClient(Connection connection, Object object) {
server.sendToTCP(connection.getID(), object);
}
}