From a0ed984bfdad195e3ee1b32292a58ba1586d42b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Tue, 28 Oct 2014 10:56:58 +0100 Subject: Map: HexList are now public, replace clear...() with direct calls --- core/src/ch/asynk/tankontank/game/Map.java | 34 +++++----------------- .../asynk/tankontank/game/states/StateAttack.java | 4 +-- .../ch/asynk/tankontank/game/states/StateMove.java | 2 +- 3 files changed, 10 insertions(+), 30 deletions(-) diff --git a/core/src/ch/asynk/tankontank/game/Map.java b/core/src/ch/asynk/tankontank/game/Map.java index 44b6690..fed7db0 100644 --- a/core/src/ch/asynk/tankontank/game/Map.java +++ b/core/src/ch/asynk/tankontank/game/Map.java @@ -21,13 +21,13 @@ public abstract class Map extends Board { private final Ctrl ctrl; - private final HexList possibleMoves; // HexSet - private final HexList possibleTargets; // PawnSet - private final HexList possiblePaths; // class Move - private final HexList moveAssists; // PawnSet - private final HexList attackAssists; // PawnSet - private final ArrayList activablePawns = new ArrayList(7); // PawnSet - private final ArrayList activatedPawns = new ArrayList(7); // PawnSet + public final HexList possibleMoves; // HexSet + public final HexList possibleTargets; // PawnSet + public final HexList possiblePaths; // class Move + public final HexList moveAssists; // PawnSet + public final HexList attackAssists; // PawnSet + public final ArrayList activablePawns = new ArrayList(7); // PawnSet + public final ArrayList activatedPawns = new ArrayList(7); // PawnSet private final SpriteAnimation explosion; private final SpriteAnimation explosions; @@ -66,26 +66,6 @@ public abstract class Map extends Board activatedPawns.clear(); } - public void clearPossiblePaths() - { - possiblePaths.clear(); - } - - public void clearPossibleTargets() - { - possibleTargets.clear(); - } - - public void clearActivablePawns() - { - activablePawns.clear(); - } - - public void clearActivatedPawns() - { - activatedPawns.clear(); - } - public Hex getHex(int col, int row) { return (Hex) getTile(col, row); diff --git a/core/src/ch/asynk/tankontank/game/states/StateAttack.java b/core/src/ch/asynk/tankontank/game/states/StateAttack.java index 5587a45..93431a1 100644 --- a/core/src/ch/asynk/tankontank/game/states/StateAttack.java +++ b/core/src/ch/asynk/tankontank/game/states/StateAttack.java @@ -8,7 +8,7 @@ public class StateAttack extends StateCommon @Override public void enter(boolean fromSelect) { - map.clearPossibleTargets(); + map.possibleTargets.clear(); ctrl.hud.show(false, false, false, true, false, ctrl.cfg.canCancel); ctrl.hud.attackBtn.setOn(); @@ -71,7 +71,7 @@ public class StateAttack extends StateCommon @Override public void abort() { - map.clearActivatedPawns(); + map.activatedPawns.clear(); super.abort(); } diff --git a/core/src/ch/asynk/tankontank/game/states/StateMove.java b/core/src/ch/asynk/tankontank/game/states/StateMove.java index 87d80ba..e959376 100644 --- a/core/src/ch/asynk/tankontank/game/states/StateMove.java +++ b/core/src/ch/asynk/tankontank/game/states/StateMove.java @@ -8,7 +8,7 @@ public class StateMove extends StateCommon @Override public void enter(boolean fromSelect) { - map.clearPossiblePaths(); + map.possiblePaths.clear(); ctrl.hud.show(false, true, true, false, ((map.activablePawnsCount() + map.activatedPawnsCount()) > 1), ctrl.cfg.canCancel); ctrl.hud.moveBtn.setOn(); -- cgit v1.1-2-g2b99