summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--core/src/ch/asynk/rustanddust/game/Battle.java2
-rw-r--r--core/src/ch/asynk/rustanddust/game/Ctrl.java6
-rw-r--r--core/src/ch/asynk/rustanddust/game/battles/BattleCommon.java5
3 files changed, 6 insertions, 7 deletions
diff --git a/core/src/ch/asynk/rustanddust/game/Battle.java b/core/src/ch/asynk/rustanddust/game/Battle.java
index df17838..03316bd 100644
--- a/core/src/ch/asynk/rustanddust/game/Battle.java
+++ b/core/src/ch/asynk/rustanddust/game/Battle.java
@@ -21,7 +21,7 @@ public interface Battle
public Position getHudPosition();
- public void init();
+ public void init(Ctrl ctrl);
public boolean actionDone();
diff --git a/core/src/ch/asynk/rustanddust/game/Ctrl.java b/core/src/ch/asynk/rustanddust/game/Ctrl.java
index ffb37df..1b21e09 100644
--- a/core/src/ch/asynk/rustanddust/game/Ctrl.java
+++ b/core/src/ch/asynk/rustanddust/game/Ctrl.java
@@ -69,8 +69,9 @@ public abstract class Ctrl implements Disposable
game.ctrl = this;
this.game = game;
this.battle = battle;
- this.map = game.factory.getMap(battle.getMapType());
this.hud = new Hud(game);
+ battle.init(this);
+ init();
this.blockMap = false;
this.blockHud = false;
@@ -91,9 +92,6 @@ public abstract class Ctrl implements Disposable
this.stateType = StateType.DONE;
StateCommon.set(game);
- battle.init();
- init();
-
hud.update();
this.hud.notify(battle.toString(), 2, Position.MIDDLE_CENTER, false);
diff --git a/core/src/ch/asynk/rustanddust/game/battles/BattleCommon.java b/core/src/ch/asynk/rustanddust/game/battles/BattleCommon.java
index 2a966b3..96ff1d2 100644
--- a/core/src/ch/asynk/rustanddust/game/battles/BattleCommon.java
+++ b/core/src/ch/asynk/rustanddust/game/battles/BattleCommon.java
@@ -3,6 +3,7 @@ package ch.asynk.rustanddust.game.battles;
import java.util.Random;
import java.util.HashMap;
+import ch.asynk.rustanddust.game.Ctrl;
import ch.asynk.rustanddust.game.Army;
import ch.asynk.rustanddust.game.Battle;
import ch.asynk.rustanddust.game.Player;
@@ -93,9 +94,9 @@ public abstract class BattleCommon implements Battle
}
@Override
- public void init()
+ public void init(Ctrl ctrl)
{
- this.map = ctrl.map;
+ ctrl.map = this.map = factory.getMap(getMapType());
this.usPlayer = factory.getPlayer(Army.US);
this.gePlayer = factory.getPlayer(Army.GE);