Updated 'ServerStartGameMessage' class.
Updated the 'ServerStartGameMessage' class by adding the 'board' attribute and its getter method to it.
This commit is contained in:
@@ -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.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user