summaryrefslogtreecommitdiffstats
path: root/core/src/ch/asynk
diff options
context:
space:
mode:
Diffstat (limited to 'core/src/ch/asynk')
-rw-r--r--core/src/ch/asynk/tankontank/game/Map.java9
1 files changed, 9 insertions, 0 deletions
diff --git a/core/src/ch/asynk/tankontank/game/Map.java b/core/src/ch/asynk/tankontank/game/Map.java
index 3178aca..1c1477c 100644
--- a/core/src/ch/asynk/tankontank/game/Map.java
+++ b/core/src/ch/asynk/tankontank/game/Map.java
@@ -2,6 +2,7 @@ package ch.asynk.tankontank.game;
import java.util.ArrayList;
import java.util.HashSet;
+import java.util.Iterator;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.g2d.TextureAtlas;
@@ -24,6 +25,7 @@ public abstract class Map extends Board
private final ArrayList<GridPoint2> possibleTargets = new ArrayList<GridPoint2>(10);
private final HashSet<GridPoint2> possiblePaths = new HashSet<GridPoint2>(10);
private final ArrayList<GridPoint2> moveAssists = new ArrayList<GridPoint2>(6);
+ private final ArrayList<GridPoint2> attackAssists = new ArrayList<GridPoint2>(6);
private final ArrayList<Pawn> activablePawns = new ArrayList<Pawn>(7);
private final ArrayList<Pawn> activatedPawns = new ArrayList<Pawn>(7);
@@ -47,6 +49,7 @@ public abstract class Map extends Board
public void clearAll()
{
moveAssists.clear();
+ clearPointVector(attackAssists);
activablePawns.clear();
activatedPawns.clear();
clearPointSet(possiblePaths);
@@ -182,6 +185,12 @@ public abstract class Map extends Board
return moveAssists.size();
}
+ public int buildAttackAssists(Pawn pawn, GridPoint2 hex, Iterator<Pawn> units)
+ {
+ buildAttackAssists(pawn, hex, units, attackAssists);
+ return attackAssists.size();
+ }
+
public void buildAndShowMovesAndAssits(Pawn pawn, GridPoint2 hex)
{
showPossibleMoves(false);