From 37c78ad512df6464ad2e6e7a04356a7ff8fe994a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Tue, 28 Oct 2014 12:21:57 +0100 Subject: Board: add Board.HexList and Board.HexSet --- core/src/ch/asynk/tankontank/game/HexList.java | 11 ---------- core/src/ch/asynk/tankontank/game/Map.java | 29 +++++++++++++++++++++----- 2 files changed, 24 insertions(+), 16 deletions(-) delete mode 100644 core/src/ch/asynk/tankontank/game/HexList.java diff --git a/core/src/ch/asynk/tankontank/game/HexList.java b/core/src/ch/asynk/tankontank/game/HexList.java deleted file mode 100644 index 9ed95fe..0000000 --- a/core/src/ch/asynk/tankontank/game/HexList.java +++ /dev/null @@ -1,11 +0,0 @@ -package ch.asynk.tankontank.game; - -import ch.asynk.tankontank.engine.TileList; - -public class HexList extends TileList -{ - public HexList(Map map, int overlay, int n) - { - super(map, overlay, n); - } -} diff --git a/core/src/ch/asynk/tankontank/game/Map.java b/core/src/ch/asynk/tankontank/game/Map.java index ab8e83c..8310788 100644 --- a/core/src/ch/asynk/tankontank/game/Map.java +++ b/core/src/ch/asynk/tankontank/game/Map.java @@ -11,14 +11,33 @@ import com.badlogic.gdx.graphics.glutils.ShapeRenderer; import ch.asynk.tankontank.TankOnTank; import ch.asynk.tankontank.engine.Pawn; import ch.asynk.tankontank.engine.Tile; +import ch.asynk.tankontank.engine.TileSet; +import ch.asynk.tankontank.engine.TileList; import ch.asynk.tankontank.engine.Board; import ch.asynk.tankontank.engine.Orientation; import ch.asynk.tankontank.engine.gfx.animations.AnimationSequence; import ch.asynk.tankontank.engine.gfx.animations.SpriteAnimation; import ch.asynk.tankontank.engine.gfx.animations.RunnableAnimation; + public abstract class Map extends Board { + public class HexList extends TileList + { + public HexList(Map map, int overlay, int n) + { + super(map, overlay, n); + } + } + + public class HexSet extends TileSet + { + public HexSet(Map map, int overlay, int n) + { + super(map, overlay, n); + } + } + private final Ctrl ctrl; public final Board.TileCollection possibleMoves; @@ -41,11 +60,11 @@ public abstract class Map extends Board this.explosion = new SpriteAnimation(game.manager.get("data/explosion.png", Texture.class), 10, 4, 40); this.explosions = new SpriteAnimation(game.manager.get("data/explosions.png", Texture.class), 16, 8, 15); setup(); - possibleMoves = new HexList(this, Hex.MOVE1, 40); - possiblePaths = new HexList(this, Hex.MOVE1, 10); // Hex.MOVE2 - possibleTargets = new HexList(this, Hex.TARGET, 10); - moveAssists = new HexList(this, Hex.ASSIST, 6); - attackAssists = new HexList(this, Hex.ASSIST, 6); + possibleMoves = new HexSet(this, Hex.MOVE1, 40); + possiblePaths = new HexSet(this, Hex.MOVE1, 10); // Hex.MOVE2 + possibleTargets = new HexList(this, Hex.TARGET, 10); // PawnSet + moveAssists = new HexList(this, Hex.ASSIST, 6); // PawnSet + attackAssists = new HexList(this, Hex.ASSIST, 6); // PawnSet } @Override -- cgit v1.1-2-g2b99