From 45cd3556d32e2ca11010e290486d6204b9149b3e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Wed, 24 Sep 2014 16:05:03 +0200 Subject: Tile.roadMarchBonus() -> Pawn.roadMarch() --- core/src/ch/asynk/tankontank/engine/Pawn.java | 1 + core/src/ch/asynk/tankontank/engine/Tile.java | 1 - core/src/ch/asynk/tankontank/game/Hex.java | 6 ------ core/src/ch/asynk/tankontank/game/Unit.java | 11 ++++++++++- 4 files changed, 11 insertions(+), 8 deletions(-) diff --git a/core/src/ch/asynk/tankontank/engine/Pawn.java b/core/src/ch/asynk/tankontank/engine/Pawn.java index 3d89676..8da9774 100644 --- a/core/src/ch/asynk/tankontank/engine/Pawn.java +++ b/core/src/ch/asynk/tankontank/engine/Pawn.java @@ -25,6 +25,7 @@ public abstract class Pawn extends Image implements Disposable private ArrayDeque path = new ArrayDeque(); public abstract int getMvt(); + public abstract int roadMarch(); public Pawn(TextureRegion region, TextureAtlas atlas) { diff --git a/core/src/ch/asynk/tankontank/engine/Tile.java b/core/src/ch/asynk/tankontank/engine/Tile.java index d2bda78..f243460 100644 --- a/core/src/ch/asynk/tankontank/engine/Tile.java +++ b/core/src/ch/asynk/tankontank/engine/Tile.java @@ -17,7 +17,6 @@ public abstract class Tile implements BasicDrawable public abstract Tile getNewAt(float x, float y); public abstract boolean atLeastOneMove(Pawn pawn); - public abstract int roadMarchBonus(Pawn pawn); public abstract boolean road(Board.Orientation side); public abstract int costFrom(Pawn pawn, Board.Orientation side, boolean road); diff --git a/core/src/ch/asynk/tankontank/game/Hex.java b/core/src/ch/asynk/tankontank/game/Hex.java index 6666e9a..161ed44 100644 --- a/core/src/ch/asynk/tankontank/game/Hex.java +++ b/core/src/ch/asynk/tankontank/game/Hex.java @@ -53,12 +53,6 @@ public class Hex extends Tile } @Override - public int roadMarchBonus(Pawn pawn) - { - return 1; - } - - @Override public boolean road(Board.Orientation side) { return (side.s == (roads & side.s)); diff --git a/core/src/ch/asynk/tankontank/game/Unit.java b/core/src/ch/asynk/tankontank/game/Unit.java index 4a9741a..40fb68d 100644 --- a/core/src/ch/asynk/tankontank/game/Unit.java +++ b/core/src/ch/asynk/tankontank/game/Unit.java @@ -16,7 +16,16 @@ public class Unit extends Pawn public Army army; @Override - public int getMvt() { return mp; } + public int getMvt() + { + return mp; + } + + @Override + public int roadMarch() + { + return 1; + } // hard tager public Unit(Army army, boolean hq, int range, int defense, int movementPoints, TextureRegion region, TextureAtlas atlas) -- cgit v1.1-2-g2b99