summaryrefslogtreecommitdiffstats
path: root/src/jrummikub/control
diff options
context:
space:
mode:
authorJannis Harder <harder@informatik.uni-luebeck.de>2011-06-19 19:05:30 +0200
committerJannis Harder <harder@informatik.uni-luebeck.de>2011-06-19 19:05:30 +0200
commit4231fad826c581040bd6530761731c482e7ff5bd (patch)
tree3dcfba9c10251c871289554e9c694fd96eb839ca /src/jrummikub/control
parentdcf87994cb4cb5083e12e2acb55ec6cf42e4d7e9 (diff)
downloadJRummikub-4231fad826c581040bd6530761731c482e7ff5bd.tar
JRummikub-4231fad826c581040bd6530761731c482e7ff5bd.zip
Fixed aborting of computer turns
git-svn-id: svn://sunsvr01.isp.uni-luebeck.de/swproj13/trunk@488 72836036-5685-4462-b002-a69064685172
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();