From c10a6b65595e4b6611b9852862700e1fac37c4fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Wed, 29 Oct 2014 12:26:59 +0100 Subject: Map: activatedPawns is a Board.PawnCollection --- core/src/ch/asynk/tankontank/engine/Tile.java | 3 ++- core/src/ch/asynk/tankontank/game/Hex.java | 3 ++- core/src/ch/asynk/tankontank/game/Map.java | 5 +++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/core/src/ch/asynk/tankontank/engine/Tile.java b/core/src/ch/asynk/tankontank/engine/Tile.java index 1c767fe..735af0e 100644 --- a/core/src/ch/asynk/tankontank/engine/Tile.java +++ b/core/src/ch/asynk/tankontank/engine/Tile.java @@ -11,6 +11,7 @@ import com.badlogic.gdx.graphics.g2d.TextureAtlas; import com.badlogic.gdx.graphics.glutils.ShapeRenderer; import com.badlogic.gdx.math.Vector2; +import ch.asynk.tankontank.engine.Board; import ch.asynk.tankontank.engine.gfx.Drawable; import ch.asynk.tankontank.engine.gfx.StackedImages; @@ -23,7 +24,7 @@ public abstract class Tile implements Drawable, Disposable private StackedImages overlays; private ArrayDeque stack; - public abstract int defenseFor(Pawn target, List foes); + public abstract int defenseFor(Pawn target, Board.PawnCollection foes); public abstract int costFrom(Pawn pawn, Orientation side, boolean road); public abstract boolean isOffMap(); diff --git a/core/src/ch/asynk/tankontank/game/Hex.java b/core/src/ch/asynk/tankontank/game/Hex.java index b357e56..45d3d43 100644 --- a/core/src/ch/asynk/tankontank/game/Hex.java +++ b/core/src/ch/asynk/tankontank/game/Hex.java @@ -5,6 +5,7 @@ import java.util.Iterator; import com.badlogic.gdx.graphics.g2d.TextureAtlas; +import ch.asynk.tankontank.engine.Board; import ch.asynk.tankontank.engine.Pawn; import ch.asynk.tankontank.engine.Tile; import ch.asynk.tankontank.engine.Orientation; @@ -109,7 +110,7 @@ public class Hex extends Tile } @Override - public int defenseFor(Pawn target, List foes) + public int defenseFor(Pawn target, Board.PawnCollection foes) { Unit u = (Unit) target; boolean terrainBonus = true; diff --git a/core/src/ch/asynk/tankontank/game/Map.java b/core/src/ch/asynk/tankontank/game/Map.java index 4f876b0..ce587a1 100644 --- a/core/src/ch/asynk/tankontank/game/Map.java +++ b/core/src/ch/asynk/tankontank/game/Map.java @@ -1,6 +1,5 @@ package ch.asynk.tankontank.game; -import java.util.ArrayList; import java.util.Iterator; import com.badlogic.gdx.assets.AssetManager; @@ -28,7 +27,7 @@ public abstract class Map extends Board public final Board.PawnCollection moveablePawns; public final Board.PawnCollection possibleTargets; public final Board.PawnCollection attackAssists; - public final ArrayList activatedPawns = new ArrayList(7); + public final Board.PawnCollection activatedPawns; private final SpriteAnimation explosion; private final SpriteAnimation explosions; @@ -49,6 +48,8 @@ public abstract class Map extends Board possibleTargets = new PawnSet(this, 10); attackAssists = new PawnSet(this, 6); + + activatedPawns = new PawnSet(this, 7); } @Override -- cgit v1.1-2-g2b99