From fd326b4a8fe67da09e960c4e2131bb2018ee1900 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Mon, 13 Oct 2014 00:33:04 +0200 Subject: Map: add buildAttackAssists(Pawn, GridPoint2, Iterator) --- core/src/ch/asynk/tankontank/game/Map.java | 9 +++++++++ 1 file changed, 9 insertions(+) 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 possibleTargets = new ArrayList(10); private final HashSet possiblePaths = new HashSet(10); private final ArrayList moveAssists = new ArrayList(6); + private final ArrayList attackAssists = new ArrayList(6); private final ArrayList activablePawns = new ArrayList(7); private final ArrayList activatedPawns = new ArrayList(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 units) + { + buildAttackAssists(pawn, hex, units, attackAssists); + return attackAssists.size(); + } + public void buildAndShowMovesAndAssits(Pawn pawn, GridPoint2 hex) { showPossibleMoves(false); -- cgit v1.1-2-g2b99