From 59a63a7ab84513d7228eeee939ddac59d6a2e2aa Mon Sep 17 00:00:00 2001 From: EpicKnarvik97 Date: Fri, 17 Apr 2020 12:57:56 +0200 Subject: [PATCH] Legger til manglende kommentarer for RoboRallyServer --- .../roborally/networking/RoboRallyServer.java | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/main/java/inf112/fiasko/roborally/networking/RoboRallyServer.java b/src/main/java/inf112/fiasko/roborally/networking/RoboRallyServer.java index ac58c85..b710f54 100644 --- a/src/main/java/inf112/fiasko/roborally/networking/RoboRallyServer.java +++ b/src/main/java/inf112/fiasko/roborally/networking/RoboRallyServer.java @@ -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 deadRobotList) { listener.setDeadPlayers(deadRobotList); } @@ -47,6 +51,7 @@ public class RoboRallyServer { public Map 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); } }