merge the new developmentbranch into the test branch #39

Closed
j23f0712 wants to merge 431 commits from development2 into dev/test
Showing only changes of commit 2248d044c1 - Show all commits

View File

@@ -11,10 +11,15 @@
*/
public class AnimationState extends GameAutomatonState {
/**
* Create FirstRollState constants.
* Create AnimationState constants.
*/
private static final System.Logger LOGGER = System.getLogger(AnimationState.class.getName());
/**
* Create AnimationState attributes.
*/
private int messageReceived = 0;
/**
* Constructs a server state of the specified game logic.
*
@@ -33,6 +38,7 @@ public void enter() {
@Override
public void exit() {
LOGGER.log(System.Logger.Level.DEBUG, "Exited AnimationState state.");
this.messageReceived = 0;
}
/**
@@ -44,7 +50,11 @@ public void exit() {
*/
@Override
public void received(AnimationEndMessage msg, int from) {
this.logic.getServerSender().send(from, new DiceNowMessage());
if (this.messageReceived == this.logic.getGame().getPlayers().size()) {
this.logic.getServerSender().send(this.logic.getGame().getActivePlayerId(), new DiceNowMessage());
this.gameAutomaton.setCurrentState(this.gameAutomaton.getTurnState());
} else {
this.messageReceived++;
}
}
}