diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2014-10-28 12:21:57 +0100 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2014-10-28 12:21:57 +0100 |
commit | 37c78ad512df6464ad2e6e7a04356a7ff8fe994a (patch) | |
tree | f4da270cbe60e44c84917312319f442d35e43f3e /core | |
parent | 4b28bdb354e063d9bddf864d6a902957d01382f1 (diff) | |
download | RustAndDust-37c78ad512df6464ad2e6e7a04356a7ff8fe994a.zip RustAndDust-37c78ad512df6464ad2e6e7a04356a7ff8fe994a.tar.gz |
Board: add Board.HexList and Board.HexSet
Diffstat (limited to 'core')
-rw-r--r-- | core/src/ch/asynk/tankontank/game/HexList.java | 11 | ||||
-rw-r--r-- | core/src/ch/asynk/tankontank/game/Map.java | 29 |
2 files changed, 24 insertions, 16 deletions
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 |