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-02 23:00:39 +01:00
parent 252c37ae9a
commit fb6cbeaaf5

View File

@@ -8,13 +8,38 @@
*/ */
@Serializable @Serializable
public class ServerStartGameMessage extends ServerMessage { public class ServerStartGameMessage extends ServerMessage {
/**
* Create ServerStartGameMessage attributes.
*/
private final Board board;
/** /**
* Constructs a new ServerStartGame instance. * Constructs a new ServerStartGame instance.
*/ */
public ServerStartGameMessage() { public ServerStartGameMessage() {
super(); super();
this.board = new Board();
} }
/**
* Constructor.
*
* @param board as the board of the game as a Board object.
*/
public ServerStartGameMessage(Board board) {
super();
this.board = board;
}
/**
* This method will return board attribute of ServerStartGameMessage class.
*
* @return board as a Board object.
*/
public Board getBoard() {
return this.board;
}
/** /**
* Accepts a visitor to process this message. * Accepts a visitor to process this message.
* *