Fixed aborting of computer turns
git-svn-id: svn://sunsvr01.isp.uni-luebeck.de/swproj13/trunk@488 72836036-5685-4462-b002-a69064685172
This commit is contained in:
parent
dcf87994cb
commit
4231fad826
1 changed files with 8 additions and 1 deletions
|
@ -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();
|
||||
|
|
Reference in a new issue