summaryrefslogtreecommitdiffstats
path: root/core/src/ch
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2014-10-28 10:56:58 +0100
committerJérémy Zurcher <jeremy@asynk.ch>2014-10-28 10:56:58 +0100
commita0ed984bfdad195e3ee1b32292a58ba1586d42b5 (patch)
tree6d53051ea5d6fa3c97c0a187daa3da8519a64492 /core/src/ch
parent8af0970a70e762228b80754e27368a623ef9b9df (diff)
downloadRustAndDust-a0ed984bfdad195e3ee1b32292a58ba1586d42b5.zip
RustAndDust-a0ed984bfdad195e3ee1b32292a58ba1586d42b5.tar.gz
Map: HexList are now public, replace clear...() with direct calls
Diffstat (limited to 'core/src/ch')
-rw-r--r--core/src/ch/asynk/tankontank/game/Map.java34
-rw-r--r--core/src/ch/asynk/tankontank/game/states/StateAttack.java4
-rw-r--r--core/src/ch/asynk/tankontank/game/states/StateMove.java2
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<Pawn> activablePawns = new ArrayList<Pawn>(7); // PawnSet
- private final ArrayList<Pawn> activatedPawns = new ArrayList<Pawn>(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<Pawn> activablePawns = new ArrayList<Pawn>(7); // PawnSet
+ public final ArrayList<Pawn> activatedPawns = new ArrayList<Pawn>(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();