summaryrefslogtreecommitdiffstats
path: root/core/src/ch
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2015-02-18 14:57:00 +0100
committerJérémy Zurcher <jeremy@asynk.ch>2015-02-18 14:57:00 +0100
commitba74c5870735ae8546dd9de55c50190843b6aa6f (patch)
treee3f71588bbcc4716a808f05b7d9ff29a948770da /core/src/ch
parent07cb6f5d7c5f48b05391824bbfc364a03cdcad5f (diff)
downloadRustAndDust-ba74c5870735ae8546dd9de55c50190843b6aa6f.zip
RustAndDust-ba74c5870735ae8546dd9de55c50190843b6aa6f.tar.gz
Map,Ctrl: add Map.init(), Ctrl call it after battle.setup()
Diffstat (limited to 'core/src/ch')
-rw-r--r--core/src/ch/asynk/tankontank/game/Ctrl.java1
-rw-r--r--core/src/ch/asynk/tankontank/game/Map.java9
-rw-r--r--core/src/ch/asynk/tankontank/game/battles/BattleTest.java1
3 files changed, 10 insertions, 1 deletions
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();
}
}