merge the new developmentbranch into the test branch #39

Closed
j23f0712 wants to merge 431 commits from development2 into dev/test
172 changed files with 3676 additions and 1781 deletions
Showing only changes of commit dd95356abd - Show all commits

View File

@@ -1,5 +1,6 @@
package pp.mdga.server.automaton.game;
import pp.mdga.game.Player;
import pp.mdga.server.ServerGameLogic;
import pp.mdga.server.automaton.GameState;
import pp.mdga.server.automaton.game.turn.*;
@@ -22,6 +23,7 @@ public class TurnState extends GameAutomatonState {
private final RollDiceState rollDiceState;
private final ChoosePieceState choosePieceState;
private final MovePieceState movePieceState;
private Player player;
/**
* Constructs a server state of the specified game logic.
@@ -42,6 +44,7 @@ public TurnState(GameState gameAutomaton, ServerGameLogic logic) {
@Override
public void enter() {
LOGGER.log(System.Logger.Level.DEBUG, "Entered TurnState state.");
this.player = this.logic.getGame().getPlayerById(this.logic.getGame().getActivePlayerId());
}
@Override
@@ -103,6 +106,15 @@ public MovePieceState getMovePieceState() {
return this.movePieceState;
}
/**
* This method will be used to return player attribute of TurnState class.
*
* @return player as a Player object.
*/
public Player getPlayer() {
return this.player;
}
/**
* This method will be used to set currentState attribute of TurnState class to the given state parameter.
* In Addition, the currentState will be exited, changed and entered.