From 6ce89509ff6ed0d456020ab00efa8c8fb07fb729 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Wed, 31 Dec 2014 20:35:21 +0100 Subject: Battle: add init() --- core/src/ch/asynk/tankontank/game/Battle.java | 2 ++ core/src/ch/asynk/tankontank/game/Ctrl.java | 2 ++ core/src/ch/asynk/tankontank/game/battles/BattleCommon.java | 5 +++++ 3 files changed, 9 insertions(+) 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); } -- cgit v1.1-2-g2b99