From 4231fad826c581040bd6530761731c482e7ff5bd Mon Sep 17 00:00:00 2001 From: Jannis Harder Date: Sun, 19 Jun 2011 19:05:30 +0200 Subject: Fixed aborting of computer turns git-svn-id: svn://sunsvr01.isp.uni-luebeck.de/swproj13/trunk@488 72836036-5685-4462-b002-a69064685172 --- src/jrummikub/control/turn/AIControl.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src') 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(); -- cgit v1.2.3