diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2014-09-29 23:49:16 +0200 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2014-09-29 23:49:16 +0200 |
commit | 9fffa1f0d6991fe9b9777e61c3b4735a9d68695d (patch) | |
tree | 0d490f1af0491ccc06e6544d0604615f7a0f7355 /core | |
parent | 9d0a18198656df48db89aee2f9925111051848f1 (diff) | |
download | RustAndDust-9fffa1f0d6991fe9b9777e61c3b4735a9d68695d.zip RustAndDust-9fffa1f0d6991fe9b9777e61c3b4735a9d68695d.tar.gz |
Tile/Hex: add boolean isOffMap()
Diffstat (limited to 'core')
-rw-r--r-- | core/src/ch/asynk/tankontank/engine/Tile.java | 1 | ||||
-rw-r--r-- | core/src/ch/asynk/tankontank/game/Hex.java | 6 |
2 files changed, 7 insertions, 0 deletions
diff --git a/core/src/ch/asynk/tankontank/engine/Tile.java b/core/src/ch/asynk/tankontank/engine/Tile.java index 8e64ce6..aaa6029 100644 --- a/core/src/ch/asynk/tankontank/engine/Tile.java +++ b/core/src/ch/asynk/tankontank/engine/Tile.java @@ -21,6 +21,7 @@ public abstract class Tile implements Drawable public abstract boolean road(Board.Orientation side); public abstract int costFrom(Pawn pawn, Board.Orientation side, boolean road); public abstract boolean hasTargetsFor(Pawn pawn); + public abstract boolean isOffMap(); public Tile(float x, float y, TextureAtlas atlas) { diff --git a/core/src/ch/asynk/tankontank/game/Hex.java b/core/src/ch/asynk/tankontank/game/Hex.java index 2d36960..f7b1e23 100644 --- a/core/src/ch/asynk/tankontank/game/Hex.java +++ b/core/src/ch/asynk/tankontank/game/Hex.java @@ -36,6 +36,12 @@ public class Hex extends Tile } @Override + public boolean isOffMap() + { + return terrain == Terrain.OFFMAP; + } + + @Override public boolean atLeastOneMove(Pawn pawn) { if (occupied() || (terrain == Terrain.BLOCKED) || (terrain == Terrain.OFFMAP)) |