From ab78e9ec8ec7250c12bc12da5d9f292ceb497bbb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Tue, 9 Jun 2020 09:41:03 +0200 Subject: HexScreen : test roadMarch --- test/src/ch/asynk/gdx/boardgame/test/HexScreen.java | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/test/src/ch/asynk/gdx/boardgame/test/HexScreen.java b/test/src/ch/asynk/gdx/boardgame/test/HexScreen.java index e60ebe2..3774856 100644 --- a/test/src/ch/asynk/gdx/boardgame/test/HexScreen.java +++ b/test/src/ch/asynk/gdx/boardgame/test/HexScreen.java @@ -34,12 +34,18 @@ class Unit extends Piece super(texture); this.hardTarget = hardTarget; if (hardTarget) { - this.mp = 3; - } else { this.mp = 2; + } else { + this.mp = 1; } } + @Override public int roadMarchBonus() + { + if (hardTarget) return 2; + return 0; + } + @Override public int getAvailableMP() { return mp; @@ -50,7 +56,7 @@ class Unit extends Piece Terrain dst = ((Hex)to).terrain; if (dst == Terrain.HILL) return 3; if (!hardTarget) return 1; - if (orientation.belongsTo(((Hex)from).roads)) return 1; + if (((Hex)from).hasRoad(orientation)) return 1; if (dst.difficult()) return 2; return 1; } @@ -126,6 +132,11 @@ class Hex extends Tile this.roads = getRoad(k); } + @Override public boolean hasRoad(Orientation orientation) + { + return orientation.belongsTo(roads); + } + @Override public boolean blockLos(final Tile from, final Tile to, float d, float dt) { int h = terrain.elevation + terrain.height; -- cgit v1.1-2-g2b99