summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2016-03-31 19:52:55 +0200
committerJérémy Zurcher <jeremy@asynk.ch>2016-03-31 19:52:55 +0200
commit9e05554fc2356e4e91874f75e9b7dc9603ab8d08 (patch)
tree81960a0704deb35a75bef6ed0129e1a2c32d0f88
parent6cd37dcf5f3b8d8c1f79bf03235cfc3d5ec80311 (diff)
downloadRustAndDust-9e05554fc2356e4e91874f75e9b7dc9603ab8d08.zip
RustAndDust-9e05554fc2356e4e91874f75e9b7dc9603ab8d08.tar.gz
Ctrl: code cleanup
-rw-r--r--core/src/ch/asynk/rustanddust/game/Ctrl.java23
1 files changed, 10 insertions, 13 deletions
diff --git a/core/src/ch/asynk/rustanddust/game/Ctrl.java b/core/src/ch/asynk/rustanddust/game/Ctrl.java
index 93e473a..f7a3ae8 100644
--- a/core/src/ch/asynk/rustanddust/game/Ctrl.java
+++ b/core/src/ch/asynk/rustanddust/game/Ctrl.java
@@ -46,9 +46,9 @@ public abstract class Ctrl implements Disposable
public final RustAndDust game;
public final Battle battle;
+ private final StringWriter writer = new StringWriter(2048);
private final IterableQueue<Event> events = new IterableQueue<Event>(4);
private final IterableStack<Event> freeEvents = new IterableStack<Event>(4);
- private final StringWriter writer = new StringWriter(2048);
public Map map;
public Hud hud;
@@ -131,25 +131,22 @@ public abstract class Ctrl implements Disposable
setState(battle.getState());
+ if (synched) {
+ this.hud.notify(battle.toString(), 2, Position.MIDDLE_CENTER, false);
+ return;
+ }
+
switch(game.config.loadMode) {
case REPLAY_ALL:
// TODO REPLAY_ALL
break;
case REPLAY_LAST:
- if (synched) {
- this.hud.notify(battle.toString(), 2, Position.MIDDLE_CENTER, false);
- } else {
- map.prepareReplayLastTurn();
- setState(StateType.REPLAY);
- }
+ map.prepareReplayLastTurn();
+ setState(StateType.REPLAY);
break;
case LOAD:
- if (synched) {
- this.hud.notify(battle.toString(), 2, Position.MIDDLE_CENTER, false);
- } else {
- map.prepareReplayLastAction();
- setState(StateType.REPLAY);
- }
+ map.prepareReplayLastAction();
+ setState(StateType.REPLAY);
break;
}