merge the new developmentbranch into the test branch #39

Closed
j23f0712 wants to merge 431 commits from development2 into dev/test
182 changed files with 4548 additions and 1923 deletions
Showing only changes of commit 9d1430e488 - Show all commits

View File

@@ -1,16 +1,14 @@
package pp.mdga.server.automaton.game;
import pp.mdga.message.client.AnimationEndMessage;
import pp.mdga.message.server.DiceNowMessage;
import pp.mdga.server.ServerGameLogic;
import pp.mdga.server.automaton.GameState;
import java.util.HashMap;
import java.util.Map;
import java.util.HashSet;
import java.util.Set;
/**
* This class represents the animation state of the game state.
*
*/
public class AnimationState extends GameAutomatonState {
/**
@@ -21,7 +19,7 @@ public class AnimationState extends GameAutomatonState {
/**
* Create AnimationState attributes.
*/
private final Map<Integer, Boolean> messageReceived = new HashMap<>();
private final Set<Integer> messageReceived = new HashSet<>();
/**
* Constructs a server state of the specified game logic.
@@ -53,7 +51,7 @@ public void exit() {
*/
@Override
public void received(AnimationEndMessage msg, int from) {
this.messageReceived.put(from, true);
this.messageReceived.add(from);
if (this.messageReceived.size() == this.logic.getGame().getPlayers().size()) {
this.gameAutomaton.setCurrentState(this.gameAutomaton.getTurnState());
this.gameAutomaton.getTurnState().setCurrentState(this.gameAutomaton.getTurnState().getPowerCardState());