summaryrefslogtreecommitdiffstats
path: root/core/src/ch/asynk/rustanddust
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2016-03-20 22:19:45 +0100
committerJérémy Zurcher <jeremy@asynk.ch>2016-03-20 22:19:45 +0100
commit271949ec25a360eb3fc41c1c48b4977313a25879 (patch)
tree6a398bc01db6f4fd39a07ab5c6342e81592e60b3 /core/src/ch/asynk/rustanddust
parentf0f9d39f1d925dd564355b0cf67efe3109ea3b83 (diff)
downloadRustAndDust-271949ec25a360eb3fc41c1c48b4977313a25879.zip
RustAndDust-271949ec25a360eb3fc41c1c48b4977313a25879.tar.gz
Ctrl: processAction/Turn() -> action/turnDoneCb() + add orderProcessedCb()
Diffstat (limited to 'core/src/ch/asynk/rustanddust')
-rw-r--r--core/src/ch/asynk/rustanddust/game/Ctrl.java5
-rw-r--r--core/src/ch/asynk/rustanddust/game/Map.java4
-rw-r--r--core/src/ch/asynk/rustanddust/game/ctrl/Solo.java10
-rw-r--r--core/src/ch/asynk/rustanddust/game/map/Map4Orders.java4
4 files changed, 16 insertions, 7 deletions
diff --git a/core/src/ch/asynk/rustanddust/game/Ctrl.java b/core/src/ch/asynk/rustanddust/game/Ctrl.java
index 284d20d..871dba6 100644
--- a/core/src/ch/asynk/rustanddust/game/Ctrl.java
+++ b/core/src/ch/asynk/rustanddust/game/Ctrl.java
@@ -47,8 +47,9 @@ public abstract class Ctrl implements Disposable
private StateType stateAfterAnimation;
public abstract void init();
- protected abstract void processAction();
- protected abstract void processTurn();
+ protected abstract void actionDoneCb();
+ protected abstract void turnDoneCb();
+ public abstract void orderProcessedCb();
public static Ctrl getCtrl(final RustAndDust game)
{
diff --git a/core/src/ch/asynk/rustanddust/game/Map.java b/core/src/ch/asynk/rustanddust/game/Map.java
index 27661f2..9695b92 100644
--- a/core/src/ch/asynk/rustanddust/game/Map.java
+++ b/core/src/ch/asynk/rustanddust/game/Map.java
@@ -32,13 +32,13 @@ public abstract class Map extends Map5Marshal
public void actionDone()
{
- game.ctrl.processAction();
+ game.ctrl.actionDoneCb();
}
public void turnDone()
{
RustAndDust.debug("TurnDone", String.format(" Processed Orders : %d", ordersSize()));
- game.ctrl.processTurn();
+ game.ctrl.turnDoneCb();
ordersClear();
}
diff --git a/core/src/ch/asynk/rustanddust/game/ctrl/Solo.java b/core/src/ch/asynk/rustanddust/game/ctrl/Solo.java
index 32e237f..6fe871f 100644
--- a/core/src/ch/asynk/rustanddust/game/ctrl/Solo.java
+++ b/core/src/ch/asynk/rustanddust/game/ctrl/Solo.java
@@ -33,13 +33,19 @@ public class Solo extends Ctrl
}
@Override
- protected void processAction()
+ public void orderProcessedCb()
+ {
+ // TODO
+ }
+
+ @Override
+ protected void actionDoneCb()
{
storeGame();
}
@Override
- protected void processTurn()
+ protected void turnDoneCb()
{
storeGame();
storeTurn();
diff --git a/core/src/ch/asynk/rustanddust/game/map/Map4Orders.java b/core/src/ch/asynk/rustanddust/game/map/Map4Orders.java
index 8cbaf89..e8ad751 100644
--- a/core/src/ch/asynk/rustanddust/game/map/Map4Orders.java
+++ b/core/src/ch/asynk/rustanddust/game/map/Map4Orders.java
@@ -160,8 +160,10 @@ public abstract class Map4Orders extends Map3Animations
break;
}
- if (r != -1)
+ if (r != -1) {
orders.add(cmd);
+ game.ctrl.orderProcessedCb();
+ }
return r;
}