summaryrefslogtreecommitdiffstats
path: root/core/src/ch/asynk
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2014-10-13 00:33:04 +0200
committerJérémy Zurcher <jeremy@asynk.ch>2014-10-13 00:33:04 +0200
commitfd326b4a8fe67da09e960c4e2131bb2018ee1900 (patch)
treea7e46a1d46006c681ac3a90e6157c887679e8fd3 /core/src/ch/asynk
parente5c1e4bc92b9ffcf9142ceeaa2e2ee4cdb60691f (diff)
downloadRustAndDust-fd326b4a8fe67da09e960c4e2131bb2018ee1900.zip
RustAndDust-fd326b4a8fe67da09e960c4e2131bb2018ee1900.tar.gz
Map: add buildAttackAssists(Pawn, GridPoint2, Iterator<Pawn>)
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);