From 593dc0170d9f0262b69e4d21eb285f7bcd1ffbf5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Wed, 18 Feb 2015 16:58:28 +0100 Subject: Map: store Command inte an OrderList till the end of turn --- core/src/ch/asynk/tankontank/game/Map.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) 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() -- cgit v1.1-2-g2b99