summaryrefslogtreecommitdiffstats
path: root/src/jrummikub/control
diff options
context:
space:
mode:
Diffstat (limited to 'src/jrummikub/control')
-rw-r--r--src/jrummikub/control/turn/AIControl.java9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/jrummikub/control/turn/AIControl.java b/src/jrummikub/control/turn/AIControl.java
index 6dac4fe..b69d72b 100644
--- a/src/jrummikub/control/turn/AIControl.java
+++ b/src/jrummikub/control/turn/AIControl.java
@@ -27,6 +27,7 @@ public class AIControl extends AbstractTurnControl {
private boolean isPaused = false;
private boolean turnDone = false;
private boolean readyToEmit = false;
+ private boolean aborted = false;
@Override
public void startTurn() {
@@ -62,6 +63,12 @@ public class AIControl extends AbstractTurnControl {
turnDone = true;
super.cleanUp();
}
+
+ @Override
+ public void abortTurn() {
+ aborted = true;
+ super.abortTurn();
+ }
private void compute() {
switch (turnInfo.getTurnMode()) {
@@ -210,7 +217,7 @@ public class AIControl extends AbstractTurnControl {
private void emitEndOfTurn() {
readyToEmit = true;
- if (isPaused) {
+ if (isPaused || aborted) {
return;
}
cleanUp();