diff options
Diffstat (limited to 'src/jrummikub/control/RoundControl.java')
-rw-r--r-- | src/jrummikub/control/RoundControl.java | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/src/jrummikub/control/RoundControl.java b/src/jrummikub/control/RoundControl.java index a19a2ab..f209f3e 100644 --- a/src/jrummikub/control/RoundControl.java +++ b/src/jrummikub/control/RoundControl.java @@ -117,7 +117,20 @@ public class RoundControl { } } - private void prepareTurn() { + protected void prepareTurn() { + doPrepareTurn(); + + boolean isHuman = roundState.getActivePlayer().getPlayerSettings() + .getType() == HUMAN; + boolean oneHuman = roundState.getGameSettings().oneHuman(); + boolean isAI = (turnControl instanceof AIControl); + + if (isAI || (isHuman && oneHuman)) { + startTurn(); + } + } + + protected void doPrepareTurn() { boolean isHuman = roundState.getActivePlayer().getPlayerSettings() .getType() == HUMAN; boolean oneHuman = roundState.getGameSettings().oneHuman(); @@ -141,12 +154,6 @@ public class RoundControl { turnControl = createTurnControl(roundState.getActivePlayer() .getPlayerSettings()); - - boolean isAI = (turnControl instanceof AIControl); - - if (isAI || (isHuman && oneHuman)) { - startTurn(); - } } protected void startTurn() { @@ -217,7 +224,7 @@ public class RoundControl { || totalValue >= roundState.getGameSettings().getInitialMeldThreshold(); } - private void endOfTurn(ITable newTable) { + protected void endOfTurn(ITable newTable) { boolean wasHuman = (turnControl instanceof HumanTurnControl); boolean wasAI = (turnControl instanceof AIControl); |