From ba74c5870735ae8546dd9de55c50190843b6aa6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Wed, 18 Feb 2015 14:57:00 +0100 Subject: Map,Ctrl: add Map.init(), Ctrl call it after battle.setup() --- core/src/ch/asynk/tankontank/game/Ctrl.java | 1 + core/src/ch/asynk/tankontank/game/Map.java | 9 ++++++++- core/src/ch/asynk/tankontank/game/battles/BattleTest.java | 1 + 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/core/src/ch/asynk/tankontank/game/Ctrl.java b/core/src/ch/asynk/tankontank/game/Ctrl.java index 09b5c5d..24f496c 100644 --- a/core/src/ch/asynk/tankontank/game/Ctrl.java +++ b/core/src/ch/asynk/tankontank/game/Ctrl.java @@ -62,6 +62,7 @@ public class Ctrl implements Disposable this.map = battle.getMap(); battle.setup(this, map); + this.map.init(); this.player = battle.getPlayer(); this.opponent = battle.opponent(player); diff --git a/core/src/ch/asynk/tankontank/game/Map.java b/core/src/ch/asynk/tankontank/game/Map.java index 3b1a5b4..625f0f2 100644 --- a/core/src/ch/asynk/tankontank/game/Map.java +++ b/core/src/ch/asynk/tankontank/game/Map.java @@ -306,7 +306,12 @@ public abstract class Map extends Board implements MoveToAnimationCb, ObjectiveS return r; } - // STATES ENTRY -> + // Ctrl Methods + + public void init() + { + actionDone(); + } public void turnDone() { @@ -325,6 +330,8 @@ public abstract class Map extends Board implements MoveToAnimationCb, ObjectiveS } } + // STATES ENTRY -> + public boolean enterBoard(Unit unit, Hex to, int allowedMoves) { Orientation entry = findBestEntry(unit, to, allowedMoves); diff --git a/core/src/ch/asynk/tankontank/game/battles/BattleTest.java b/core/src/ch/asynk/tankontank/game/battles/BattleTest.java index f2f7fd4..e844d15 100644 --- a/core/src/ch/asynk/tankontank/game/battles/BattleTest.java +++ b/core/src/ch/asynk/tankontank/game/battles/BattleTest.java @@ -122,6 +122,7 @@ public class BattleTest extends BattleCommon setUnit(map, usPlayer, UnitId.US_INFANTRY, 5, 3, Orientation.NORTH_WEST, usExit); setUnit(map, usPlayer, UnitId.US_AT_GUN, 10, 3, Orientation.SOUTH, usExit); usPlayer.turnEnd(); + map.init(); map.turnDone(); } } -- cgit v1.1-2-g2b99