Updated 'ServerStartGameMessage' class.
Updated the 'ServerStartGameMessage' class by adding the 'players' attribute and its getter method to it.
This commit is contained in:
@@ -2,6 +2,10 @@
|
|||||||
|
|
||||||
import com.jme3.network.serializing.Serializable;
|
import com.jme3.network.serializing.Serializable;
|
||||||
import pp.mdga.game.Board;
|
import pp.mdga.game.Board;
|
||||||
|
import pp.mdga.game.Player;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A message indicating that the game shall start.
|
* A message indicating that the game shall start.
|
||||||
@@ -11,26 +15,39 @@ public class ServerStartGameMessage extends ServerMessage {
|
|||||||
/**
|
/**
|
||||||
* Create ServerStartGameMessage attributes.
|
* Create ServerStartGameMessage attributes.
|
||||||
*/
|
*/
|
||||||
|
private final List<Player> players;
|
||||||
private final Board board;
|
private final Board board;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructs a new ServerStartGame instance.
|
* Constructor.
|
||||||
*/
|
*/
|
||||||
public ServerStartGameMessage() {
|
public ServerStartGameMessage() {
|
||||||
super();
|
super();
|
||||||
|
this.players = new ArrayList<>();
|
||||||
this.board = new Board();
|
this.board = new Board();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor.
|
* Constructor.
|
||||||
*
|
*
|
||||||
* @param board as the board of the game as a Board object.
|
* @param players as the connected players as a List of Player objects.
|
||||||
|
* @param board as the board of the game as a Board object.
|
||||||
*/
|
*/
|
||||||
public ServerStartGameMessage(Board board) {
|
public ServerStartGameMessage(List<Player> players, Board board) {
|
||||||
super();
|
super();
|
||||||
|
this.players = players;
|
||||||
this.board = board;
|
this.board = board;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This method will be used to return players attribute of ServerStartGameMessage class.
|
||||||
|
*
|
||||||
|
* @return players as a List of Player objects.
|
||||||
|
*/
|
||||||
|
public List<Player> getPlayers() {
|
||||||
|
return this.players;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This method will return board attribute of ServerStartGameMessage class.
|
* This method will return board attribute of ServerStartGameMessage class.
|
||||||
*
|
*
|
||||||
|
|||||||
Reference in New Issue
Block a user