summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2015-02-18 14:41:37 +0100
committerJérémy Zurcher <jeremy@asynk.ch>2015-02-18 14:41:37 +0100
commit2d5302585838851e1dcb5164dee46c65295224e4 (patch)
tree37faf5728b11d072565f1bea6164e261493a2fba
parent0573d58f1446a5fb81a460be48460514cc59ef18 (diff)
downloadRustAndDust-2d5302585838851e1dcb5164dee46c65295224e4.zip
RustAndDust-2d5302585838851e1dcb5164dee46c65295224e4.tar.gz
Map: turnDone() throws RuntimeException if Map structures not cleared by actionDone()
-rw-r--r--core/src/ch/asynk/tankontank/game/Map.java5
1 files changed, 4 insertions, 1 deletions
diff --git a/core/src/ch/asynk/tankontank/game/Map.java b/core/src/ch/asynk/tankontank/game/Map.java
index 517afc8..3a004ed 100644
--- a/core/src/ch/asynk/tankontank/game/Map.java
+++ b/core/src/ch/asynk/tankontank/game/Map.java
@@ -310,7 +310,10 @@ public abstract class Map extends Board implements MoveToAnimationCb, ObjectiveS
public void turnDone()
{
- objectives.forget();
+ if (engagement != null)
+ throw new RuntimeException("engagement not cleared");
+ if (objectives.modifiedCount() > 0)
+ throw new RuntimeException("objectives not cleared");
}
public void actionDone()