Updated the JavaDocs in multiple classes, to improve readability.

This commit is contained in:
Daniel Grigencha
2024-12-05 05:21:33 +01:00
parent e81aa67d36
commit 3b0cd9ebdb
16 changed files with 77 additions and 37 deletions

View File

@@ -15,6 +15,7 @@ public class IncorrectRequestMessage extends ServerMessage {
* @param id as the id of the error message as an Integer.
*/
public IncorrectRequestMessage(int id) {
super();
this.id = id;
}
@@ -22,6 +23,7 @@ public IncorrectRequestMessage(int id) {
* Constructor.
*/
public IncorrectRequestMessage() {
super();
this.id = 0;
}

View File

@@ -42,6 +42,7 @@ public LobbyPlayerJoinedMessage(int id, Player player, boolean host) {
* Default constructor for serialization purposes.
*/
private LobbyPlayerJoinedMessage() {
super();
player = null;
id = 0;
host = false;

View File

@@ -27,6 +27,7 @@ public LobbyPlayerLeaveMessage(int id) {
* Default constructor for serialization purposes.
*/
private LobbyPlayerLeaveMessage() {
super();
id = 0;
}

View File

@@ -40,6 +40,7 @@ public MoveMessage(UUID identifier, boolean isHomeMove, int targetIndex) {
* Default constructor for serialization purposes.
*/
private MoveMessage() {
super();
pieceUUID = null;
targetIndex = 0;
isHomeMove = false;

View File

@@ -7,7 +7,6 @@
*/
@Serializable
public class PauseGameMessage extends ServerMessage {
/**
* the id of the player who has disconnected
*/

View File

@@ -20,8 +20,14 @@ public class PlayCardMessage extends ServerMessage {
*/
private final UUID ownPieceID;
/**
* The identifier of the enemy piece that should be moved.
*/
private final UUID enemyPieceID;
/**
* The modifier of the dice.
*/
private final int diceModifier;
/**

View File

@@ -5,11 +5,24 @@
import java.util.List;
import java.util.UUID;
/**
* A message sent by the server to the active player to select a piece to move.
*/
@Serializable
public class SelectPieceMessage extends ServerMessage {
/**
* The list of pieces
*/
private final List<UUID> pieces;
/**
* The list of booleans of isHomeMove of the pieces
*/
private final List<Boolean> isHomeMove;
/**
* The list of indexes of target nodes of the pieces
*/
private final List<Integer> targetIndex;
/**
@@ -20,6 +33,7 @@ public class SelectPieceMessage extends ServerMessage{
* @param targetIndex the List of indexes of target nodes of the pieces
*/
public SelectPieceMessage(List<UUID> pieces, List<Boolean> isHomeMove, List<Integer> targetIndex) {
super();
this.pieces = pieces;
this.isHomeMove = isHomeMove;
this.targetIndex = targetIndex;
@@ -29,6 +43,7 @@ public SelectPieceMessage(List<UUID> pieces, List<Boolean> isHomeMove, List<Inte
* Default constructor for serialization purposes.
*/
public SelectPieceMessage() {
super();
pieces = null;
isHomeMove = null;
targetIndex = null;

View File

@@ -36,7 +36,7 @@ public interface ServerInterpreter {
/**
* Handles a Die message received from the server.
*
* @param msg the Dice message received
* @param msg the Die message received
*/
void received(DieMessage msg);
@@ -55,16 +55,16 @@ public interface ServerInterpreter {
void received(DiceNowMessage msg);
/**
* Handles an EndOfGame message received from the server.
* Handles an EndOfTurn message received from the server.
*
* @param msg the EndOfGame message received
* @param msg the EndOfTurn message received
*/
void received(EndOfTurnMessage msg);
/**
* Handles a GameOver message received from the server.
* Handles a LobbyAccept message received from the server.
*
* @param msg the GameOver message received
* @param msg the LobbyAccept message received
*/
void received(LobbyAcceptMessage msg);
@@ -132,9 +132,9 @@ public interface ServerInterpreter {
void received(PossiblePieceMessage msg);
/**
* Handles a RankingResponce message received from the server.
* Handles a RankingResponse message received from the server.
*
* @param msg the RankingResponce message received
* @param msg the RankingResponse message received
*/
void received(RankingResponseMessage msg);
@@ -209,9 +209,9 @@ public interface ServerInterpreter {
void received(SelectPieceMessage msg);
/**
* Handles a SelectTSK message received from the server.
* Handles a Shutdown message received from the server.
*
* @param msg the SelectTSK message received.
* @param msg the Shutdown message received.
*/
void received(ShutdownMessage msg);

View File

@@ -13,9 +13,13 @@
@Serializable
public class ServerStartGameMessage extends ServerMessage {
/**
* Create ServerStartGameMessage attributes.
* The list of players.
*/
private final List<Player> players;
/**
* The board of the game.
*/
private final Board board;
/**

View File

@@ -7,6 +7,13 @@
*/
@Serializable
public class ShutdownMessage extends ServerMessage {
/**
* Constructs a new Shutdown message.
*/
public ShutdownMessage() {
super();
}
/**
* Accepts a visitor to process this message.
*

View File

@@ -1,7 +1,7 @@
package pp.mdga.message.server;
/**
*
* A message sent by the server to indicate that the client is now a spectator.
*/
public class SpectatorMessage extends ServerMessage {
/**
@@ -12,7 +12,6 @@ public SpectatorMessage() {
}
/**
*
* @param interpreter the visitor to process this message
*/
@Override

View File

@@ -18,6 +18,9 @@ public class UpdateTSKMessage extends ServerMessage {
*/
private final Color color;
/**
* The flag if the TSK is taken.
*/
private final boolean isTaken;
/**

View File

@@ -9,7 +9,9 @@
*/
@Serializable
public class WaitPieceMessage extends ServerMessage {
/**
* The pieceID of the piece to choose.
*/
private final UUID pieceID;
/**