summaryrefslogtreecommitdiffstats
path: root/core/src/ch/asynk/tankontank
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2014-12-31 20:35:21 +0100
committerJérémy Zurcher <jeremy@asynk.ch>2014-12-31 20:35:21 +0100
commit6ce89509ff6ed0d456020ab00efa8c8fb07fb729 (patch)
tree2649fbdfc224b5d3db0aaf9b4f8367bde3d9dc98 /core/src/ch/asynk/tankontank
parent6f0d00c76e5ec970af3b14df948cb7598f78fd94 (diff)
downloadRustAndDust-6ce89509ff6ed0d456020ab00efa8c8fb07fb729.zip
RustAndDust-6ce89509ff6ed0d456020ab00efa8c8fb07fb729.tar.gz
Battle: add init()
Diffstat (limited to 'core/src/ch/asynk/tankontank')
-rw-r--r--core/src/ch/asynk/tankontank/game/Battle.java2
-rw-r--r--core/src/ch/asynk/tankontank/game/Ctrl.java2
-rw-r--r--core/src/ch/asynk/tankontank/game/battles/BattleCommon.java5
3 files changed, 9 insertions, 0 deletions
diff --git a/core/src/ch/asynk/tankontank/game/Battle.java b/core/src/ch/asynk/tankontank/game/Battle.java
index 7bbd962..8625dd4 100644
--- a/core/src/ch/asynk/tankontank/game/Battle.java
+++ b/core/src/ch/asynk/tankontank/game/Battle.java
@@ -8,6 +8,8 @@ import ch.asynk.tankontank.ui.Position;
public interface Battle
{
+ public void init();
+
public String getName();
public String getDescription();
diff --git a/core/src/ch/asynk/tankontank/game/Ctrl.java b/core/src/ch/asynk/tankontank/game/Ctrl.java
index 9947d87..63a372a 100644
--- a/core/src/ch/asynk/tankontank/game/Ctrl.java
+++ b/core/src/ch/asynk/tankontank/game/Ctrl.java
@@ -53,6 +53,8 @@ public class Ctrl implements Disposable
this.cfg = game.config;
game.ctrl = this;
+ battle.init();
+
this.map = battle.getMap();
battle.setup(this, map);
this.player = battle.getPlayer();
diff --git a/core/src/ch/asynk/tankontank/game/battles/BattleCommon.java b/core/src/ch/asynk/tankontank/game/battles/BattleCommon.java
index dd5cb6d..9be7403 100644
--- a/core/src/ch/asynk/tankontank/game/battles/BattleCommon.java
+++ b/core/src/ch/asynk/tankontank/game/battles/BattleCommon.java
@@ -33,6 +33,11 @@ public abstract class BattleCommon implements Battle
public BattleCommon(Factory factory)
{
this.factory = factory;
+ }
+
+ @Override
+ public void init()
+ {
this.usPlayer = factory.getPlayer(Army.US);
this.gePlayer = factory.getPlayer(Army.GE);
}