summaryrefslogtreecommitdiffstats
path: root/core/src/ch/asynk/rustanddust
diff options
context:
space:
mode:
Diffstat (limited to 'core/src/ch/asynk/rustanddust')
-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.java7
3 files changed, 7 insertions, 8 deletions
diff --git a/core/src/ch/asynk/rustanddust/game/Battle.java b/core/src/ch/asynk/rustanddust/game/Battle.java
index b6471dc..3e958f6 100644
--- a/core/src/ch/asynk/rustanddust/game/Battle.java
+++ b/core/src/ch/asynk/rustanddust/game/Battle.java
@@ -19,7 +19,7 @@ public interface Battle
public Position getHudPosition();
- public State.StateType setup(Ctrl ctrl);
+ public void init();
public boolean actionDone();
diff --git a/core/src/ch/asynk/rustanddust/game/Ctrl.java b/core/src/ch/asynk/rustanddust/game/Ctrl.java
index 29202fa..ffb37df 100644
--- a/core/src/ch/asynk/rustanddust/game/Ctrl.java
+++ b/core/src/ch/asynk/rustanddust/game/Ctrl.java
@@ -91,9 +91,13 @@ public abstract class Ctrl implements Disposable
this.stateType = StateType.DONE;
StateCommon.set(game);
- setState(battle.setup(this));
+ battle.init();
+ init();
+ hud.update();
this.hud.notify(battle.toString(), 2, Position.MIDDLE_CENTER, false);
+
+ setState(battle.getState());
}
@Override
diff --git a/core/src/ch/asynk/rustanddust/game/battles/BattleCommon.java b/core/src/ch/asynk/rustanddust/game/battles/BattleCommon.java
index be55d2e..205af5e 100644
--- a/core/src/ch/asynk/rustanddust/game/battles/BattleCommon.java
+++ b/core/src/ch/asynk/rustanddust/game/battles/BattleCommon.java
@@ -3,7 +3,6 @@ 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;
@@ -94,14 +93,12 @@ public abstract class BattleCommon implements Battle
}
@Override
- public State.StateType setup(Ctrl ctrl)
+ public void init()
{
this.map = ctrl.map;
this.usPlayer = factory.getPlayer(Army.US);
this.gePlayer = factory.getPlayer(Army.GE);
- ctrl.hud.update();
- ctrl.init();
setupMap();
this.currentPlayer = this.usPlayer;
@@ -117,8 +114,6 @@ public abstract class BattleCommon implements Battle
map.turnDone();
this.currentPlayer = getFirstPlayer();
-
- return getState();
}
@Override