merge the new developmentbranch into the test branch #39

Closed
j23f0712 wants to merge 431 commits from development2 into dev/test
16 changed files with 77 additions and 37 deletions
Showing only changes of commit 3b0cd9ebdb - Show all commits

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -36,7 +36,7 @@ public interface ServerInterpreter {
/** /**
* Handles a Die message received from the server. * Handles a Die message received from the server.
* *
* @param msg the Dice message received * @param msg the Die message received
*/ */
void received(DieMessage msg); void received(DieMessage msg);
@@ -55,16 +55,16 @@ public interface ServerInterpreter {
void received(DiceNowMessage msg); 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); 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); void received(LobbyAcceptMessage msg);
@@ -132,9 +132,9 @@ public interface ServerInterpreter {
void received(PossiblePieceMessage msg); 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); void received(RankingResponseMessage msg);
@@ -209,9 +209,9 @@ public interface ServerInterpreter {
void received(SelectPieceMessage msg); 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); void received(ShutdownMessage msg);

View File

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

View File

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

View File

@@ -1,7 +1,7 @@
package pp.mdga.message.server; 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 { public class SpectatorMessage extends ServerMessage {
/** /**
@@ -12,7 +12,6 @@ public SpectatorMessage() {
} }
/** /**
*
* @param interpreter the visitor to process this message * @param interpreter the visitor to process this message
*/ */
@Override @Override

View File

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

View File

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