summaryrefslogtreecommitdiffstats
path: root/src/jrummikub/control/RoundControl.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/jrummikub/control/RoundControl.java')
-rw-r--r--src/jrummikub/control/RoundControl.java20
1 files changed, 17 insertions, 3 deletions
diff --git a/src/jrummikub/control/RoundControl.java b/src/jrummikub/control/RoundControl.java
index 285980a..8dbf236 100644
--- a/src/jrummikub/control/RoundControl.java
+++ b/src/jrummikub/control/RoundControl.java
@@ -81,7 +81,10 @@ public class RoundControl {
* Begin the round
*/
public void startRound() {
- deal();
+ if (roundState != null) {
+ deal();
+ }
+
continueRound();
}
@@ -103,7 +106,9 @@ public class RoundControl {
}
}));
- prepareTurn();
+ if (roundState != null) {
+ prepareTurn();
+ }
}
/**
@@ -117,11 +122,16 @@ public class RoundControl {
}
}
+ protected void setRoundState(IRoundState state) {
+ roundState = state;
+ roundStateUpdateEvent.emit(state);
+ }
+
protected void prepareTurn() {
doPrepareTurn();
boolean isHuman = roundState.getActivePlayer().getPlayerSettings()
- .getType() == HUMAN;
+ .getType() == HUMAN;
boolean oneHuman = roundState.getGameSettings().oneHuman();
boolean isAI = (turnControl instanceof AIControl);
@@ -157,6 +167,10 @@ public class RoundControl {
}
protected void startTurn() {
+ if (turnControl == null) {
+ doPrepareTurn();
+ }
+
boolean isHuman = roundState.getActivePlayer().getPlayerSettings()
.getType() == HUMAN;