summaryrefslogtreecommitdiffstats
path: root/core/src/ch/asynk/rustanddust
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2016-01-25 00:00:38 +0100
committerJérémy Zurcher <jeremy@asynk.ch>2016-01-25 00:00:38 +0100
commit2db803147a794cc1804edb2233e37027515069bc (patch)
tree60ed38716c5eeade2403d5136fe9b0b71ad7bc2b /core/src/ch/asynk/rustanddust
parent2c1cda5a078a6b27824e968def1334cb122a2881 (diff)
downloadRustAndDust-2db803147a794cc1804edb2233e37027515069bc.zip
RustAndDust-2db803147a794cc1804edb2233e37027515069bc.tar.gz
Ctrl: add abstract init() and processTurn()
Diffstat (limited to 'core/src/ch/asynk/rustanddust')
-rw-r--r--core/src/ch/asynk/rustanddust/game/Ctrl.java3
-rw-r--r--core/src/ch/asynk/rustanddust/game/Map.java5
-rw-r--r--core/src/ch/asynk/rustanddust/game/battles/BattleCommon.java1
-rw-r--r--core/src/ch/asynk/rustanddust/game/ctrl/Solo.java6
4 files changed, 12 insertions, 3 deletions
diff --git a/core/src/ch/asynk/rustanddust/game/Ctrl.java b/core/src/ch/asynk/rustanddust/game/Ctrl.java
index 8b51867..6a49de2 100644
--- a/core/src/ch/asynk/rustanddust/game/Ctrl.java
+++ b/core/src/ch/asynk/rustanddust/game/Ctrl.java
@@ -46,6 +46,9 @@ public abstract class Ctrl implements Disposable
private StateType stateType;
private StateType stateAfterAnimation;
+ public abstract void init();
+ protected abstract void processTurn();
+
public static Ctrl getCtrl(final RustAndDust game)
{
Ctrl ctrl = null;
diff --git a/core/src/ch/asynk/rustanddust/game/Map.java b/core/src/ch/asynk/rustanddust/game/Map.java
index 2386f5d..2208448 100644
--- a/core/src/ch/asynk/rustanddust/game/Map.java
+++ b/core/src/ch/asynk/rustanddust/game/Map.java
@@ -36,9 +36,8 @@ public abstract class Map extends Map4Orders
public void turnDone()
{
- RustAndDust.debug("TurnDone", String.format(" Processed Commands : %d", commandsSize()));
-
- // FIXME must emit the turn commands
+ RustAndDust.debug("TurnDone", String.format(" Processed Orders : %d", ordersSize()));
+ game.ctrl.processTurn();
ordersClear();
}
diff --git a/core/src/ch/asynk/rustanddust/game/battles/BattleCommon.java b/core/src/ch/asynk/rustanddust/game/battles/BattleCommon.java
index f8ba8db..844b6cf 100644
--- a/core/src/ch/asynk/rustanddust/game/battles/BattleCommon.java
+++ b/core/src/ch/asynk/rustanddust/game/battles/BattleCommon.java
@@ -101,6 +101,7 @@ public abstract class BattleCommon implements Battle
this.gePlayer = factory.getPlayer(Army.GE);
ctrl.hud.update();
+ ctrl.init();
setupMap();
this.currentPlayer = this.usPlayer;
diff --git a/core/src/ch/asynk/rustanddust/game/ctrl/Solo.java b/core/src/ch/asynk/rustanddust/game/ctrl/Solo.java
index b1ad673..4c71bc0 100644
--- a/core/src/ch/asynk/rustanddust/game/ctrl/Solo.java
+++ b/core/src/ch/asynk/rustanddust/game/ctrl/Solo.java
@@ -10,4 +10,10 @@ public class Solo extends Ctrl
{
super(game, battle);
}
+
+ @Override
+ public void init() { }
+
+ @Override
+ protected void processTurn() { }
}