diff options
-rw-r--r-- | src/jrummikub/control/turn/AIControl.java | 9 |
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(); |