Updated 'ServerStartGameMessage' class.

Updated the 'ServerStartGameMessage' class by adding the 'board' attribute and its getter method to it.
This commit is contained in:
Daniel Grigencha
2024-12-01 23:39:36 +01:00
parent 02d7ef1dd8
commit 8f53b76a3e

View File

@@ -1,17 +1,33 @@
package pp.mdga.message.server;
import com.jme3.network.serializing.Serializable;
import pp.mdga.game.Board;
/**
* A message indicating that the game shall start.
*/
@Serializable
public class ServerStartGameMessage extends ServerMessage {
/**
* Create ServerStartGameMessage attributes.
*/
private final Board board;
/**
* Constructs a new ServerStartGame instance.
*/
public ServerStartGameMessage() {
super();
this.board = null;
}
/**
* Constructor.
*
* @param board as the complete board of this game as a Board object.
*/
public ServerStartGameMessage(Board board) {
this.board = board;
}
/**
@@ -24,6 +40,15 @@ public void accept(ServerInterpreter interpreter) {
interpreter.received(this);
}
/**
* This method will be used to return board attribute of ServerStartGameMessage class.
*
* @return board as a Board object.
*/
public Board getBoard() {
return this.board;
}
/**
* Returns a string representation of this message.
*