diff --git a/Projekte/mdga/model/src/main/java/pp.mdga/message/client/AnimationEnd.java b/Projekte/mdga/model/src/main/java/pp.mdga/message/client/AnimationEnd.java index b564a96b..c6bfa62e 100644 --- a/Projekte/mdga/model/src/main/java/pp.mdga/message/client/AnimationEnd.java +++ b/Projekte/mdga/model/src/main/java/pp.mdga/message/client/AnimationEnd.java @@ -1,11 +1,35 @@ package pp.mdga.message.client; +import com.jme3.network.serializing.Serializable; + +/** + * A message indicating an animation event is finished in the game. + */ +@Serializable public class AnimationEnd extends ClientMessage { - @Override - public String toString() { - return "null"; + /** + * Constructs an AnimationEnd message. + */ + public AnimationEnd() { + super(); } + /** + * Returns a string representation of this message. + * + * @return a string representation of this message + */ + @Override + public String toString() { + return "AnimationEnd{}"; + } + + /** + * Accepts a visitor for processing this message. + * + * @param interpreter the visitor to be used for processing + * @param from the connection ID of the sender + */ @Override public void accept(ClientInterpreter interpreter, int from) { interpreter.received(this, from); diff --git a/Projekte/mdga/model/src/main/java/pp.mdga/message/client/ClientInterpreter.java b/Projekte/mdga/model/src/main/java/pp.mdga/message/client/ClientInterpreter.java index 0b7ec4d5..6e0565d0 100644 --- a/Projekte/mdga/model/src/main/java/pp.mdga/message/client/ClientInterpreter.java +++ b/Projekte/mdga/model/src/main/java/pp.mdga/message/client/ClientInterpreter.java @@ -1,37 +1,143 @@ package pp.mdga.message.client; +/** + * Visitor interface for processing all client messages. + */ public interface ClientInterpreter { - void received(AnimationEnd animationEnd, int from); + /** + * Processes a received AnimationEnd message. + * + * @param msg the AnimationEnd message to be processed + * @param from the connection ID from which the message was received + */ + void received(AnimationEnd msg, int from); - void received(DeselectTSK deselectTSK , int from); + /** + * Processes a received DeselectTSK message. + * + * @param msg the DeselectTSK message to be processed + * @param from the connection ID from which the message was received + */ + void received(DeselectTSK msg, int from); - void received(ForceStartGame forceStartGame, int from); - void received(JoinServer joinServer , int from); + /** + * Processes a received ForceStartGame message. + * + * @param msg the ForceStartGame message to be processed + * @param from the connection ID from which the message was received + */ + void received(ForceStartGame msg, int from); - void received(LeaveGame leaveGame , int from); + /** + * Processes a received JoinServer message. + * + * @param msg the JoinServer message to be processed + * @param from the connection ID from which the message was received + */ + void received(JoinServer msg, int from); - void received(LobbyNotReady lobbyNotReady , int from); + /** + * Processes a received LeaveGame message. + * + * @param msg the LeaveGame message to be processed + * @param from the connection ID from which the message was received + */ + void received(LeaveGame msg, int from); - void received(LobbyReady lobbyReady , int from); + /** + * Processes a received LobbyNotReady message. + * + * @param msg the LobbyNotReady message to be processed + * @param from the connection ID from which the message was received + */ + void received(LobbyNotReady msg, int from); - void received(RequestBriefing requestBriefing , int from); + /** + * Processes a received LobbyReady message. + * + * @param msg the LobbyReady message to be processed + * @param from the connection ID from which the message was received + */ + void received(LobbyReady msg, int from); - void received(RequestDice requestDice , int from); + /** + * Processes a received RequestBriefing message. + * + * @param msg the RequestBriefing message to be processed + * @param from the connection ID from which the message was received + */ + void received(RequestBriefing msg, int from); - void received(RequestMove requestMove , int from); + /** + * Processes a received RequestDice message. + * + * @param msg the RequestDice message to be processed + * @param from the connection ID from which the message was received + */ + void received(RequestDice msg, int from); - void received(RequestPlayCard requestPlayCard , int from); + /** + * Processes a received RequestMove message. + * + * @param msg the RequestMove message to be processed + * @param from the connection ID from which the message was received + */ + void received(RequestMove msg, int from); - void received(SelectCard selectCard , int from); + /** + * Processes a received RequestPlayCard message. + * + * @param msg the RequestPlayCard message to be processed + * @param from the connection ID from which the message was received + */ + void received(RequestPlayCard msg, int from); - void received(SelectTSK selectTSK , int from); + /** + * Processes a received SelectCard message. + * + * @param msg the SelectCard message to be processed + * @param from the connection ID from which the message was received + */ + void received(SelectCard msg, int from); - void received(ForceContinueGame forceContinueGame, int from); + /** + * Processes a received SelectTSK message. + * + * @param msg the SelectTSK message to be processed + * @param from the connection ID from which the message was received + */ + void received(SelectTSK msg, int from); - void received(ClientStartGame clientStartGame, int from); + /** + * Processes a received ForceContinueGame message. + * + * @param msg the ForceContinueGame message to be processed + * @param from the connection ID from which the message was received + */ + void received(ForceContinueGame msg, int from); - void received(NoPowerCard noPowerCard, int from); + /** + * Processes a received ClientStartGame message. + * + * @param msg the ClientStartGame message to be processed + * @param from the connection ID from which the message was received + */ + void received(ClientStartGame msg, int from); - void received(SelectedPieces selectedPieces, int from); + /** + * Processes a received NoPowerCard message. + * + * @param msg the NoPowerCard message to be processed + * @param from the connection ID from which the message was received + */ + void received(NoPowerCard msg, int from); + + /** + * Processes a received SelectedPieces message. + * + * @param msg the SelectedPieces message to be processed + * @param from the connection ID from which the message was received + */ + void received(SelectedPieces msg, int from); } diff --git a/Projekte/mdga/model/src/main/java/pp.mdga/message/client/ClientMessage.java b/Projekte/mdga/model/src/main/java/pp.mdga/message/client/ClientMessage.java index 9ae2d921..35a22cf2 100644 --- a/Projekte/mdga/model/src/main/java/pp.mdga/message/client/ClientMessage.java +++ b/Projekte/mdga/model/src/main/java/pp.mdga/message/client/ClientMessage.java @@ -2,10 +2,23 @@ import com.jme3.network.AbstractMessage; +/** + * An abstract base class for client messages used in network transfer. + * It extends the AbstractMessage class provided by the jme3-network library. + */ public abstract class ClientMessage extends AbstractMessage { + /** + * Constructs a new ClientMessage instance. + */ protected ClientMessage() { super(true); } + /** + * Accepts a visitor for processing this message. + * + * @param interpreter the visitor to be used for processing + * @param from the connection ID of the sender + */ public abstract void accept(ClientInterpreter interpreter, int from); } diff --git a/Projekte/mdga/model/src/main/java/pp.mdga/message/client/ClientStartGame.java b/Projekte/mdga/model/src/main/java/pp.mdga/message/client/ClientStartGame.java index 86a69f73..bde881e1 100644 --- a/Projekte/mdga/model/src/main/java/pp.mdga/message/client/ClientStartGame.java +++ b/Projekte/mdga/model/src/main/java/pp.mdga/message/client/ClientStartGame.java @@ -1,11 +1,35 @@ package pp.mdga.message.client; +import com.jme3.network.serializing.Serializable; + +/** + * A message sent by the host to start the game. + */ +@Serializable public class ClientStartGame extends ClientMessage { - @Override - public String toString() { - return "null"; + /** + * Constructs a new ClientStartGame instance. + */ + public ClientStartGame() { + super(); } + /** + * Returns a string representation of this message. + * + * @return a string representation of this message + */ + @Override + public String toString() { + return "ClientStartGame{}"; + } + + /** + * Accepts a visitor to process this message. + * + * @param interpreter the visitor to process this message + * @param from the connection ID from which the message was received + */ @Override public void accept(ClientInterpreter interpreter, int from) { interpreter.received(this, from); diff --git a/Projekte/mdga/model/src/main/java/pp.mdga/message/client/DeselectTSK.java b/Projekte/mdga/model/src/main/java/pp.mdga/message/client/DeselectTSK.java index 854c1995..77e85c03 100644 --- a/Projekte/mdga/model/src/main/java/pp.mdga/message/client/DeselectTSK.java +++ b/Projekte/mdga/model/src/main/java/pp.mdga/message/client/DeselectTSK.java @@ -1,23 +1,53 @@ package pp.mdga.message.client; +import com.jme3.network.serializing.Serializable; import pp.mdga.game.Color; +/** + * A message sent by a client to deselect a TSK. + */ +@Serializable public class DeselectTSK extends ClientMessage { + /** + * The color associated with the TSK to be deselected. + */ private final Color color; + /** + * Constructs a new DeselectTSK message with the specified color. + * + * @param color the color associated with the TSK to be deselected + */ public DeselectTSK(Color color) { + super(); this.color = color; } + /** + * Returns the color associated with the TSK to be deselected. + * + * @return the color associated with the TSK to be deselected + */ public Color getColor() { return color; } + /** + * Returns a string representation of this message. + * + * @return a string representation of this message + */ @Override public String toString() { - return "null"; + return "DeselectTSK{" + "color=" + color + '}'; } + /** + * Accepts a visitor to process this message. + * + * @param interpreter the visitor to process this message + * @param from the connection ID from which the message was received + */ @Override public void accept(ClientInterpreter interpreter, int from) { interpreter.received(this, from); diff --git a/Projekte/mdga/model/src/main/java/pp.mdga/message/client/ForceContinueGame.java b/Projekte/mdga/model/src/main/java/pp.mdga/message/client/ForceContinueGame.java index 1dd6e603..de6615f1 100644 --- a/Projekte/mdga/model/src/main/java/pp.mdga/message/client/ForceContinueGame.java +++ b/Projekte/mdga/model/src/main/java/pp.mdga/message/client/ForceContinueGame.java @@ -1,11 +1,35 @@ package pp.mdga.message.client; +import com.jme3.network.serializing.Serializable; + +/** + * A message sent by the host to force the continuation of the game, when the game was interrupted. + */ +@Serializable public class ForceContinueGame extends ClientMessage { - @Override - public String toString() { - return "null"; + /** + * Constructs a new ForceContinueGame message. + */ + public ForceContinueGame() { + super(); } + /** + * Returns a string representation of this message. + * + * @return a string representation of this message + */ + @Override + public String toString() { + return "ForceContinueGame{}"; + } + + /** + * Accepts a visitor to process this message. + * + * @param interpreter the visitor to process this message + * @param from the connection ID from which the message was received + */ @Override public void accept(ClientInterpreter interpreter, int from) { interpreter.received(this, from); diff --git a/Projekte/mdga/model/src/main/java/pp.mdga/message/client/ForceStartGame.java b/Projekte/mdga/model/src/main/java/pp.mdga/message/client/ForceStartGame.java index 32bf769c..2a98e880 100644 --- a/Projekte/mdga/model/src/main/java/pp.mdga/message/client/ForceStartGame.java +++ b/Projekte/mdga/model/src/main/java/pp.mdga/message/client/ForceStartGame.java @@ -1,15 +1,35 @@ package pp.mdga.message.client; -public class ForceStartGame extends ClientMessage { - public ForceStartGame() { +import com.jme3.network.serializing.Serializable; +/** + * A message sent by the host to force start the game when not everyone is ready or not everyone has selected a TSK. + */ +@Serializable +public class ForceStartGame extends ClientMessage { + /** + * Constructs a new ForceStartGame message. + */ + public ForceStartGame() { + super(); } + /** + * Returns a string representation of this message. + * + * @return a string representation of this message + */ @Override public String toString() { - return "null"; + return "ForceStartGame{}"; } + /** + * Accepts a visitor to process this message. + * + * @param interpreter the visitor to process this message + * @param from the connection ID from which the message was received + */ @Override public void accept(ClientInterpreter interpreter, int from) { interpreter.received(this, from); diff --git a/Projekte/mdga/model/src/main/java/pp.mdga/message/client/JoinServer.java b/Projekte/mdga/model/src/main/java/pp.mdga/message/client/JoinServer.java index 9971ab68..a7192fe9 100644 --- a/Projekte/mdga/model/src/main/java/pp.mdga/message/client/JoinServer.java +++ b/Projekte/mdga/model/src/main/java/pp.mdga/message/client/JoinServer.java @@ -1,11 +1,35 @@ package pp.mdga.message.client; +import com.jme3.network.serializing.Serializable; + +/** + * A message sent by a client when joining the server. + */ +@Serializable public class JoinServer extends ClientMessage { - @Override - public String toString() { - return "null"; + /** + * Constructs a new JoinServer instance. + */ + public JoinServer() { + super(); } + /** + * Returns a string representation of this message. + * + * @return a string representation of this message + */ + @Override + public String toString() { + return "JoinServer{}"; + } + + /** + * Accepts a visitor to process this message. + * + * @param interpreter the visitor to process this message + * @param from the connection ID from which the message was received + */ @Override public void accept(ClientInterpreter interpreter, int from) { interpreter.received(this, from); diff --git a/Projekte/mdga/model/src/main/java/pp.mdga/message/client/LeaveGame.java b/Projekte/mdga/model/src/main/java/pp.mdga/message/client/LeaveGame.java index 2da13e64..c6c7fda3 100644 --- a/Projekte/mdga/model/src/main/java/pp.mdga/message/client/LeaveGame.java +++ b/Projekte/mdga/model/src/main/java/pp.mdga/message/client/LeaveGame.java @@ -1,11 +1,35 @@ package pp.mdga.message.client; +import com.jme3.network.serializing.Serializable; + +/** + * A message sent by a client to leave the game. + */ +@Serializable public class LeaveGame extends ClientMessage { - @Override - public String toString() { - return "null"; + /** + * Constructs a new LeaveGame instance. + */ + public LeaveGame() { + super(); } + /** + * Returns a string representation of this message. + * + * @return a string representation of this message + */ + @Override + public String toString() { + return "LeaveGame{}"; + } + + /** + * Accepts a visitor to process this message. + * + * @param interpreter the visitor to process this message + * @param from the connection ID from which the message was received + */ @Override public void accept(ClientInterpreter interpreter, int from) { interpreter.received(this, from); diff --git a/Projekte/mdga/model/src/main/java/pp.mdga/message/client/LobbyNotReady.java b/Projekte/mdga/model/src/main/java/pp.mdga/message/client/LobbyNotReady.java index 8709c648..fb853c3f 100644 --- a/Projekte/mdga/model/src/main/java/pp.mdga/message/client/LobbyNotReady.java +++ b/Projekte/mdga/model/src/main/java/pp.mdga/message/client/LobbyNotReady.java @@ -1,11 +1,35 @@ package pp.mdga.message.client; +import com.jme3.network.serializing.Serializable; + +/** + * A message sent by a client to unready in the lobby. + */ +@Serializable public class LobbyNotReady extends ClientMessage { - @Override - public String toString() { - return "null"; + /** + * Constructs a new LobbyNotReady instance. + */ + public LobbyNotReady() { + super(); } + /** + * Returns a string representation of this message. + * + * @return a string representation of this message + */ + @Override + public String toString() { + return "LobbyNotReady{}"; + } + + /** + * Accepts a visitor to process this message. + * + * @param interpreter the visitor to process this message + * @param from the connection ID from which the message was received + */ @Override public void accept(ClientInterpreter interpreter, int from) { interpreter.received(this, from); diff --git a/Projekte/mdga/model/src/main/java/pp.mdga/message/client/LobbyReady.java b/Projekte/mdga/model/src/main/java/pp.mdga/message/client/LobbyReady.java index 838111ba..3427a15c 100644 --- a/Projekte/mdga/model/src/main/java/pp.mdga/message/client/LobbyReady.java +++ b/Projekte/mdga/model/src/main/java/pp.mdga/message/client/LobbyReady.java @@ -1,11 +1,35 @@ package pp.mdga.message.client; +import com.jme3.network.serializing.Serializable; + +/** + * A message sent by the client to ready-up in the lobby. + */ +@Serializable public class LobbyReady extends ClientMessage { - @Override - public String toString() { - return "null"; + /** + * Constructs a new LobbyReady instance. + */ + public LobbyReady() { + super(); } + /** + * Returns a string representation of this message. + * + * @return a string representation of this message + */ + @Override + public String toString() { + return "LobbyReady{}"; + } + + /** + * Accepts a visitor to process this message. + * + * @param interpreter the visitor to process this message + * @param from the connection ID from which the message was received + */ @Override public void accept(ClientInterpreter interpreter, int from) { interpreter.received(this, from); diff --git a/Projekte/mdga/model/src/main/java/pp.mdga/message/client/NoPowerCard.java b/Projekte/mdga/model/src/main/java/pp.mdga/message/client/NoPowerCard.java index 3fa227de..edce79c8 100644 --- a/Projekte/mdga/model/src/main/java/pp.mdga/message/client/NoPowerCard.java +++ b/Projekte/mdga/model/src/main/java/pp.mdga/message/client/NoPowerCard.java @@ -1,11 +1,35 @@ package pp.mdga.message.client; +import com.jme3.network.serializing.Serializable; + +/** + * A message sent by a client to indicate that the player is not using a power card. + */ +@Serializable public class NoPowerCard extends ClientMessage { - @Override - public String toString() { - return "null"; + /** + * Constructs a new NoPowerCard instance. + */ + public NoPowerCard() { + super(); } + /** + * Returns a string representation of this message. + * + * @return a string representation of this message + */ + @Override + public String toString() { + return "NoPowerCard{}"; + } + + /** + * Accepts a visitor to process this message. + * + * @param interpreter the visitor to process this message + * @param from the connection ID from which the message was received + */ @Override public void accept(ClientInterpreter interpreter, int from) { interpreter.received(this, from); diff --git a/Projekte/mdga/model/src/main/java/pp.mdga/message/client/RequestBriefing.java b/Projekte/mdga/model/src/main/java/pp.mdga/message/client/RequestBriefing.java index d1c12ff8..60fa41ba 100644 --- a/Projekte/mdga/model/src/main/java/pp.mdga/message/client/RequestBriefing.java +++ b/Projekte/mdga/model/src/main/java/pp.mdga/message/client/RequestBriefing.java @@ -1,11 +1,35 @@ package pp.mdga.message.client; +import com.jme3.network.serializing.Serializable; + +/** + * A message sent by a client to request a briefing from the server. (after a reconnect) + */ +@Serializable public class RequestBriefing extends ClientMessage { - @Override - public String toString() { - return "null"; + /** + * Constructs a new RequestBriefing instance. + */ + public RequestBriefing() { + super(); } + /** + * Returns a string representation of this message. + * + * @return a string representation of this message + */ + @Override + public String toString() { + return "RequestBriefing{}"; + } + + /** + * Accepts a visitor to process this message. + * + * @param interpreter the visitor to process this message + * @param from the connection ID from which the message was received + */ @Override public void accept(ClientInterpreter interpreter, int from) { interpreter.received(this, from); diff --git a/Projekte/mdga/model/src/main/java/pp.mdga/message/client/RequestDice.java b/Projekte/mdga/model/src/main/java/pp.mdga/message/client/RequestDice.java index 298866d1..bfd687bd 100644 --- a/Projekte/mdga/model/src/main/java/pp.mdga/message/client/RequestDice.java +++ b/Projekte/mdga/model/src/main/java/pp.mdga/message/client/RequestDice.java @@ -1,11 +1,35 @@ package pp.mdga.message.client; +import com.jme3.network.serializing.Serializable; + +/** + * A message sent by a client to request a die roll. + */ +@Serializable public class RequestDice extends ClientMessage { - @Override - public String toString() { - return "null"; + /** + * Constructs a new RequestDice instance. + */ + public RequestDice() { + super(); } + /** + * Returns a string representation of this message. + * + * @return a string representation of this message + */ + @Override + public String toString() { + return "RequestDice{}"; + } + + /** + * Accepts a visitor to process this message. + * + * @param interpreter the visitor to process this message + * @param from the connection ID from which the message was received + */ @Override public void accept(ClientInterpreter interpreter, int from) { interpreter.received(this, from); diff --git a/Projekte/mdga/model/src/main/java/pp.mdga/message/client/RequestMove.java b/Projekte/mdga/model/src/main/java/pp.mdga/message/client/RequestMove.java index 48fd187d..a2b14f23 100644 --- a/Projekte/mdga/model/src/main/java/pp.mdga/message/client/RequestMove.java +++ b/Projekte/mdga/model/src/main/java/pp.mdga/message/client/RequestMove.java @@ -1,30 +1,49 @@ package pp.mdga.message.client; -import pp.mdga.game.Color; +import com.jme3.network.serializing.Serializable; +/** + * A message sent by a client to request a move for a piece. + */ +@Serializable public class RequestMove extends ClientMessage { - + /** + * The identifier for the piece. + */ private final String pieceIdentifier; - /** Constructor for RequestMove + /** + * Constructor for RequestMove * @param pieceIdentifier the piece identifier */ public RequestMove(String pieceIdentifier) { this.pieceIdentifier = pieceIdentifier; } - /** Getter for the piece identifier + /** + * Getter for the piece identifier * @return the piece identifier */ public String getPieceIdentifier() { return pieceIdentifier; } + /** + * Returns a string representation of this message. + * + * @return a string representation of this message + */ @Override public String toString() { - return pieceIdentifier; + return "RequestMove{pieceIdentifier = " + pieceIdentifier + '}'; } + /** + * Accepts a visitor to process this message. + * + * @param interpreter the visitor to process this message + * @param from the connection ID from which the message was received + */ @Override public void accept(ClientInterpreter interpreter, int from) { interpreter.received(this, from); diff --git a/Projekte/mdga/model/src/main/java/pp.mdga/message/client/RequestPlayCard.java b/Projekte/mdga/model/src/main/java/pp.mdga/message/client/RequestPlayCard.java index 67885e0f..17c25f61 100644 --- a/Projekte/mdga/model/src/main/java/pp.mdga/message/client/RequestPlayCard.java +++ b/Projekte/mdga/model/src/main/java/pp.mdga/message/client/RequestPlayCard.java @@ -1,30 +1,68 @@ package pp.mdga.message.client; +import com.jme3.network.serializing.Serializable; import pp.mdga.game.BonusCard; +/** + * A message sent by a client to request playing a bonus card. + */ +@Serializable public class RequestPlayCard extends ClientMessage { - + /** + * The bonus card to be played. + */ private final BonusCard card; + + /** + * The identifier of the piece. + */ private final String pieceIdentifier; + /** + * Constructs a new RequestPlayCard instance. + * + * @param card the bonus card to be played + * @param pieceIdentifier the identifier of the piece + */ public RequestPlayCard(BonusCard card, String pieceIdentifier) { this.pieceIdentifier = pieceIdentifier; this.card = card; } + /** + * Gets the bonus card associated with this request. + * + * @return the bonus card + */ public BonusCard getCard() { return card; } + /** + * Gets the piece identifier associated with this request. + * + * @return the piece identifier + */ public String getPieceIdentifier() { return pieceIdentifier; } + /** + * Returns a string representation of this message. + * + * @return a string representation of this message + */ @Override public String toString() { - return card.toString(); + return "RequestPlayCard={card=" + card.toString() + '}'; } + /** + * Accepts a visitor to process this message. + * + * @param interpreter the visitor to process this message + * @param from the connection ID from which the message was received + */ @Override public void accept(ClientInterpreter interpreter, int from) { interpreter.received(this, from); diff --git a/Projekte/mdga/model/src/main/java/pp.mdga/message/client/SelectCard.java b/Projekte/mdga/model/src/main/java/pp.mdga/message/client/SelectCard.java index 44957a6c..a50d1fe6 100644 --- a/Projekte/mdga/model/src/main/java/pp.mdga/message/client/SelectCard.java +++ b/Projekte/mdga/model/src/main/java/pp.mdga/message/client/SelectCard.java @@ -1,24 +1,52 @@ package pp.mdga.message.client; +import com.jme3.network.serializing.Serializable; import pp.mdga.game.BonusCard; +/** + * A message sent from the client to the server to select a bonus card. + */ +@Serializable public class SelectCard extends ClientMessage { - + /** + * The bonus card to be selected. + */ private final BonusCard card; + /** + * Constructs a new SelectCard instance. + * + * @param card the bonus card to be selected + */ public SelectCard(BonusCard card) { this.card = card; } + /** + * Gets the bonus card associated with this selection. + * + * @return the bonus card + */ public BonusCard getCard() { return card; } + /** + * Returns a string representation of this message. + * + * @return a string representation of this message + */ @Override public String toString() { - return "null"; + return "SelectCard{card=" + card + '}'; } + /** + * Accepts a visitor to process this message. + * + * @param interpreter the visitor to process this message + * @param from the connection ID from which the message was received + */ @Override public void accept(ClientInterpreter interpreter, int from) { interpreter.received(this, from); diff --git a/Projekte/mdga/model/src/main/java/pp.mdga/message/client/SelectTSK.java b/Projekte/mdga/model/src/main/java/pp.mdga/message/client/SelectTSK.java index 02a5c4cf..6b870434 100644 --- a/Projekte/mdga/model/src/main/java/pp.mdga/message/client/SelectTSK.java +++ b/Projekte/mdga/model/src/main/java/pp.mdga/message/client/SelectTSK.java @@ -1,7 +1,9 @@ package pp.mdga.message.client; +import com.jme3.network.serializing.Serializable; import pp.mdga.game.Color; +@Serializable public class SelectTSK extends ClientMessage { private final Color color; @@ -13,12 +15,23 @@ public SelectTSK(Color color) { public Color getColor() { return color; } - + + /** + * Returns a string representation of this message. + * + * @return a string representation of this message + */ @Override public String toString() { - return "null"; + return "SelectTSK{color=" + color + '}'; } + /** + * Accepts a visitor to process this message. + * + * @param interpreter the visitor to process this message + * @param from the connection ID from which the message was received + */ @Override public void accept(ClientInterpreter interpreter, int from) { interpreter.received(this, from); diff --git a/Projekte/mdga/model/src/main/java/pp.mdga/message/client/SelectedPieces.java b/Projekte/mdga/model/src/main/java/pp.mdga/message/client/SelectedPieces.java index 50290e19..2e4f6a8d 100644 --- a/Projekte/mdga/model/src/main/java/pp.mdga/message/client/SelectedPieces.java +++ b/Projekte/mdga/model/src/main/java/pp.mdga/message/client/SelectedPieces.java @@ -1,30 +1,49 @@ package pp.mdga.message.client; -import pp.mdga.game.Color; +import com.jme3.network.serializing.Serializable; +/** + * A message sent by a client to indicate that a piece has been selected for a bonus cards. + */ +@Serializable public class SelectedPieces extends ClientMessage { - + /** + * The piece identifier. + */ private String pieceIdentifier; - /** Constructor for SelectedPieces + /** + * Constructor for SelectedPieces * @param pieceIdentifier the piece identifier */ public SelectedPieces(String pieceIdentifier) { this.pieceIdentifier = pieceIdentifier; } - /** Getter for the piece identifier + /** + * Getter for the piece identifier * @return the piece identifier */ public String getPieceIdentifier() { return pieceIdentifier; } + /** + * Returns a string representation of this message. + * + * @return a string representation of this message + */ @Override public String toString() { - return "null"; + return "SelectedPieces{pieceIdentifier=" + pieceIdentifier + '}'; } + /** + * Accepts a visitor to process this message. + * + * @param interpreter the visitor to process this message + * @param from the connection ID from which the message was received + */ @Override public void accept(ClientInterpreter interpreter, int from) { interpreter.received(this, from);