diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2015-01-19 12:23:58 +0100 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2015-01-19 12:23:58 +0100 |
commit | 51f534e24dc3406851693990ad2dc748ae642816 (patch) | |
tree | 91bbede87d527ffabebd09ad859f6a6849ad04ea | |
parent | 3c4291606b93a1ccc00bbbfe2aa514f742055970 (diff) | |
download | RustAndDust-51f534e24dc3406851693990ad2dc748ae642816.zip RustAndDust-51f534e24dc3406851693990ad2dc748ae642816.tar.gz |
Tile,Hex: add exitCost()
-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 5f08b4e..2939ef8 100644 --- a/core/src/ch/asynk/tankontank/engine/Tile.java +++ b/core/src/ch/asynk/tankontank/engine/Tile.java @@ -29,6 +29,7 @@ public abstract class Tile implements Drawable, Disposable, Iterable<Pawn> private ArrayDeque<Pawn> stack; public abstract int defense(); + public abstract int exitCost(); public abstract int costFrom(Pawn pawn, Orientation side); 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 1bb826c..f1ba86a 100644 --- a/core/src/ch/asynk/tankontank/game/Hex.java +++ b/core/src/ch/asynk/tankontank/game/Hex.java @@ -100,6 +100,12 @@ public class Hex extends Tile } @Override + public int exitCost() + { + return 1; + } + + @Override public int costFrom(Pawn pawn, Orientation side) { if (hasUnits()) return (Integer.MAX_VALUE / 2); |