Commit 2d4174c6 authored by Hans Mackowiak's avatar Hans Mackowiak

Update ExtraTurn in PlayerView

parent ebdfd94f
......@@ -873,10 +873,13 @@ public class PhaseHandler implements java.io.Serializable {
}
public final ExtraTurn addExtraTurn(final Player player) {
Player previous = null;
// use a stack to handle extra turns, make sure the bottom of the stack
// restores original turn order
if (extraTurns.isEmpty()) {
extraTurns.push(new ExtraTurn(game.getNextPlayerAfter(playerTurn)));
} else {
previous = extraTurns.peek().getPlayer();
}
ExtraTurn result = extraTurns.push(new ExtraTurn(player));
......@@ -884,6 +887,16 @@ public class PhaseHandler implements java.io.Serializable {
for (final Player p : game.getPlayers()) {
p.setExtraTurnCount(getExtraTurnForPlayer(p));
}
// get all players where the view should be updated
List<Player> toUpdate = Lists.newArrayList(player);
if (previous != null) {
toUpdate.add(previous);
}
// fireEvent to update the Details
game.fireEvent(new GameEventPlayerStatsChanged(toUpdate));
return result;
}
......
......@@ -412,6 +412,8 @@ public final class CMatchUI
if (vHand != null) {
vHand.getLayoutControl().updateHand();
}
// update Cards in Hand
getFieldViewFor(owner).updateDetails();
}
if (updateAnte) {
cAntes.update();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment