diff options
Diffstat (limited to 'src/jrummikub/control/RoundControl.java')
-rw-r--r-- | src/jrummikub/control/RoundControl.java | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/src/jrummikub/control/RoundControl.java b/src/jrummikub/control/RoundControl.java index 86f8e05..4819aad 100644 --- a/src/jrummikub/control/RoundControl.java +++ b/src/jrummikub/control/RoundControl.java @@ -9,6 +9,7 @@ import java.util.Set; import jrummikub.control.turn.ITurnControl; import jrummikub.control.turn.TurnControlFactory; +import jrummikub.control.turn.TurnMode; import jrummikub.model.Hand; import jrummikub.model.IHand; import jrummikub.model.IPlayer; @@ -103,19 +104,24 @@ public class RoundControl { return; boolean isHuman = roundState.getActivePlayer().getPlayerSettings() .getTurnControlType() == HUMAN; - boolean inspectOnly = roundState.getTurnNumber() < 1; - boolean mayRedeal = inspectOnly - && roundState.getActivePlayer().getHand().getIdenticalStoneCount() >= 3; + + TurnMode turnMode = TurnMode.NORMAL_TURN; + + if (roundState.getTurnNumber() < 1) { + turnMode = TurnMode.INSPECT_ONLY; + if (roundState.getActivePlayer().getHand().getIdenticalStoneCount() >= 3) { + turnMode = TurnMode.MAY_REDEAL; + } + } if (isHuman) { - view.getPlayerPanel().setEndTurnMode(inspectOnly, mayRedeal); + view.getPlayerPanel().setEndTurnMode(turnMode); } turnControl = TurnControlFactory.getFactory( roundState.getActivePlayer().getPlayerSettings().getTurnControlType()) .create(); - turnControl - .setup(roundState.getGameSettings(), roundState.getActivePlayer(), - clonedTable, view, inspectOnly, mayRedeal); + turnControl.setup(roundState.getGameSettings(), + roundState.getActivePlayer(), clonedTable, view, turnMode); turnControl.getEndOfTurnEvent().add(new IListener() { @Override public void handle() { |