diff options
author | Matthias Schiffer <mschiffer@universe-factory.net> | 2011-06-19 23:19:01 +0200 |
---|---|---|
committer | Matthias Schiffer <mschiffer@universe-factory.net> | 2011-06-19 23:19:01 +0200 |
commit | 9df549727672e8df768d46e3ef1fb0c7957f0f89 (patch) | |
tree | 3ad4ef018dfb850aee56771c4227d9ce0b32be7e /src/jrummikub/control/RoundControl.java | |
parent | 890051a3e93a31d0e1a6bc1a1d1bc14a7205b8b9 (diff) | |
download | JRummikub-9df549727672e8df768d46e3ef1fb0c7957f0f89.tar JRummikub-9df549727672e8df768d46e3ef1fb0c7957f0f89.zip |
Make NetworkRoundControl test work
git-svn-id: svn://sunsvr01.isp.uni-luebeck.de/swproj13/trunk@496 72836036-5685-4462-b002-a69064685172
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); |