From a7e90e154140e931a4ed9abb6222ec1df659e97f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Wed, 18 Feb 2015 21:40:03 +0100 Subject: Map: orderList -> commands, Command.clearPool in dispose() --- core/src/ch/asynk/tankontank/game/Map.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/core/src/ch/asynk/tankontank/game/Map.java b/core/src/ch/asynk/tankontank/game/Map.java index 32a8e7d..3f1a552 100644 --- a/core/src/ch/asynk/tankontank/game/Map.java +++ b/core/src/ch/asynk/tankontank/game/Map.java @@ -60,7 +60,7 @@ public abstract class Map extends Board implements MoveToAnimationCb, ObjectiveS private long soundId = -1; private Animation animationClosure; - private OrderList orderList; + private OrderList commands; protected abstract void setup(); @@ -106,7 +106,7 @@ public abstract class Map extends Board implements MoveToAnimationCb, ObjectiveS objectives = new ObjectiveSet(this, 4); meteorology = new Meteorology(); - orderList = new OrderList(); + commands = new OrderList(); } @Override @@ -120,6 +120,7 @@ public abstract class Map extends Board implements MoveToAnimationCb, ObjectiveS PromoteAnimation.free(); FireAnimation.free(); commands.dispose(); + Command.clearPool(); Engagement.clearPool(); } @@ -351,9 +352,8 @@ public abstract class Map extends Board implements MoveToAnimationCb, ObjectiveS break; } - if (r != -1) { - orderList.add(cmd); - } + if (r != -1) + commands.add(cmd); return r; } @@ -367,13 +367,13 @@ public abstract class Map extends Board implements MoveToAnimationCb, ObjectiveS public void turnDone() { - TankOnTank.debug("TurnDone", String.format(" Processed Commands : %d", orderList.size())); + TankOnTank.debug("TurnDone", String.format(" Processed Commands : %d", commands.size())); if (objectives.modifiedCount() > 0) throw new RuntimeException("objectives not cleared"); // FIXME do something with these Commands - orderList.dispose(); + commands.dispose(); } public void actionDone() -- cgit v1.1-2-g2b99