2424public abstract class AbstractClient implements ILobbyClientListener {
2525 private static final Logger logger = LoggerFactory .getLogger (AbstractClient .class );
2626
27- /** The handler reacts to messages from the server received by the lobby client */
27+ /** The handler reacts to messages from the server received by the lobby client. */
2828 protected IGameHandler handler ;
2929
30- /** The lobby client, that connects to the room */
30+ /** The lobby client that connects to the room. */
3131 private LobbyClient client ;
3232
3333 private String gameType ;
3434
35- /** If the client made an error (rule violation), store reason here */
35+ /** If the client made an error (rule violation), store reason here. */
3636 private String error ;
3737
38- /** current id to identify the client instance internal */
38+ /** Current id to identify the client instance internally. */
3939 private PlayerType id ;
40- /** the current room in which the player is */
40+ /** Current room of the player. */
4141 private String roomId ;
42- /** the current host */
4342 private String host ;
44- /** the current port */
4543 private int port ;
46- /** current figurecolor to identify which client belongs to which player */
44+ /** Current team color to identify which client belongs to which player. */
4745 private Team color ;
4846
4947 public AbstractClient (String host , int port , PlayerType id ) throws IOException {
@@ -71,18 +69,12 @@ public void setHandler(IGameHandler handler) {
7169 this .handler = handler ;
7270 }
7371
74- /**
75- * Tell this client to observe the game given by the preparation handler
76- *
77- * @return controllable game
78- */
72+ /** Tell this client to observe the game given by the preparation handler. */
7973 public IControllableGame observeGame (PrepareGameProtocolMessage handle ) {
8074 return this .client .observe (handle );
8175 }
8276
83- /**
84- * Called when a new message is sent to the room, e.g. move requests
85- */
77+ /** Called when a new message is sent to the room, e.g. move requests. */
8678 @ Override
8779 public void onRoomMessage (String roomId , Object data ) {
8880 if (data instanceof MoveRequest ) {
@@ -93,16 +85,12 @@ public void onRoomMessage(String roomId, Object data) {
9385 this .roomId = roomId ;
9486 }
9587
96- /**
97- * sends the <code>move</code> to the server
98- *
99- * @param move the move you want to do
100- */
88+ /** Sends the <code>move</code> to the server. */
10189 public void sendMove (Move move ) {
10290 this .client .sendMessageToRoom (this .roomId , move );
10391 }
10492
105- /** Called when an error is sent to the room */
93+ /** Called when an error is sent to the room. */
10694 @ Override
10795 public void onError (String roomId , ProtocolErrorMessage response ) {
10896 logger .debug ("onError: Client {} received error {}" , this , response .getMessage ());
0 commit comments