summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2015-02-18 16:58:28 +0100
committerJérémy Zurcher <jeremy@asynk.ch>2015-02-18 16:58:28 +0100
commit593dc0170d9f0262b69e4d21eb285f7bcd1ffbf5 (patch)
tree2af172926ab0009eb3c15d332dc270f8b4f6a2fa
parentcb191cd106c289e5db9835a473a59919b240c303 (diff)
downloadRustAndDust-593dc0170d9f0262b69e4d21eb285f7bcd1ffbf5.zip
RustAndDust-593dc0170d9f0262b69e4d21eb285f7bcd1ffbf5.tar.gz
Map: store Command inte an OrderList till the end of turn
-rw-r--r--core/src/ch/asynk/tankontank/game/Map.java13
1 files changed, 13 insertions, 0 deletions
diff --git a/core/src/ch/asynk/tankontank/game/Map.java b/core/src/ch/asynk/tankontank/game/Map.java
index aa14ea4..20076b1 100644
--- a/core/src/ch/asynk/tankontank/game/Map.java
+++ b/core/src/ch/asynk/tankontank/game/Map.java
@@ -16,6 +16,7 @@ import ch.asynk.tankontank.engine.Faction;
import ch.asynk.tankontank.engine.Move;
import ch.asynk.tankontank.engine.SelectedTile;
import ch.asynk.tankontank.engine.ObjectiveSet;
+import ch.asynk.tankontank.engine.OrderList;
import ch.asynk.tankontank.engine.Orientation;
import ch.asynk.tankontank.engine.Meteorology;
import ch.asynk.tankontank.engine.PathBuilder;
@@ -60,6 +61,8 @@ public abstract class Map extends Board implements MoveToAnimationCb, ObjectiveS
private Animation animationClosure;
private Engagement engagement;
+ private OrderList orderList;
+
protected abstract void setup();
public int d6()
@@ -104,6 +107,7 @@ public abstract class Map extends Board implements MoveToAnimationCb, ObjectiveS
objectives = new ObjectiveSet(this, 4);
meteorology = new Meteorology();
+ orderList = new OrderList();
}
@Override
@@ -322,6 +326,10 @@ public abstract class Map extends Board implements MoveToAnimationCb, ObjectiveS
break;
}
+ if (r != -1) {
+ orderList.add(cmd);
+ }
+
return r;
}
@@ -334,10 +342,15 @@ public abstract class Map extends Board implements MoveToAnimationCb, ObjectiveS
public void turnDone()
{
+ TankOnTank.debug("TurnDone", String.format(" Processed Commands : %d", orderList.size()));
+
if (engagement != null)
throw new RuntimeException("engagement not cleared");
if (objectives.modifiedCount() > 0)
throw new RuntimeException("objectives not cleared");
+
+ // FIXME do something with these Commands
+ orderList.clear();
}
public void actionDone()