diff --git a/Server/src/main/java/uulm/teamname/marvelous/server/lobbymanager/Participant.java b/Server/src/main/java/uulm/teamname/marvelous/server/lobbymanager/Participant.java index bd25a11..1fe0747 100644 --- a/Server/src/main/java/uulm/teamname/marvelous/server/lobbymanager/Participant.java +++ b/Server/src/main/java/uulm/teamname/marvelous/server/lobbymanager/Participant.java @@ -8,7 +8,7 @@ import java.util.Objects; public class Participant { /** The Websocket to contact the participant with */ - public final WebSocket connection; + private WebSocket connection; /** The type (as in role) of participant */ public final ParticipantType type; @@ -23,6 +23,21 @@ public class Participant { this.AI = AI; } + /** Returns the {@link WebSocket} to contact the participant with */ + public WebSocket getConnection() { + return connection; + } + + /** Sets the connection {@link WebSocket} for the current participant */ + public void setConnection(WebSocket connection) { + this.connection = connection; + } + + /** Removes reference to current connection from Participant */ + public void clearConnection() { + this.connection = null; + } + @Override public boolean equals(Object o) { if (this == o) return true; @@ -35,4 +50,13 @@ public class Participant { public int hashCode() { return Objects.hash(connection, type, AI); } + + @Override + public String toString() { + return "Participant{" + + "connection=" + connection + + ", type=" + type + + ", AI=" + AI + + '}'; + } }