summaryrefslogtreecommitdiffstats
path: root/core/src/ch
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2016-01-19 10:36:19 +0100
committerJérémy Zurcher <jeremy@asynk.ch>2016-01-19 10:36:19 +0100
commit650e16fcfbb3f77f9a877735a2bc02834af66ed9 (patch)
tree28c2f65f7e2fd3d985ddee9b4cbc8c327920910f /core/src/ch
parent2b9cda532770d1e2a209e19e3aa83e8f3dc6d8c3 (diff)
downloadRustAndDust-650e16fcfbb3f77f9a877735a2bc02834af66ed9.zip
RustAndDust-650e16fcfbb3f77f9a877735a2bc02834af66ed9.tar.gz
Ctrl: add getCtrl(GameMode)
Diffstat (limited to 'core/src/ch')
-rw-r--r--core/src/ch/asynk/rustanddust/game/Ctrl.java12
-rw-r--r--core/src/ch/asynk/rustanddust/screens/GameScreen.java3
2 files changed, 13 insertions, 2 deletions
diff --git a/core/src/ch/asynk/rustanddust/game/Ctrl.java b/core/src/ch/asynk/rustanddust/game/Ctrl.java
index e793ba0..302ca87 100644
--- a/core/src/ch/asynk/rustanddust/game/Ctrl.java
+++ b/core/src/ch/asynk/rustanddust/game/Ctrl.java
@@ -4,6 +4,7 @@ import com.badlogic.gdx.utils.Disposable;
import ch.asynk.rustanddust.RustAndDust;
import ch.asynk.rustanddust.ui.Position;
+import ch.asynk.rustanddust.game.ctrl.Solo;
import ch.asynk.rustanddust.game.State.StateType;
import ch.asynk.rustanddust.game.states.StateCommon;
import ch.asynk.rustanddust.game.states.StateSelect;
@@ -45,6 +46,17 @@ public abstract class Ctrl implements Disposable
private StateType stateType;
private StateType stateAfterAnimation;
+ public static Ctrl getCtrl(final RustAndDust game)
+ {
+ Ctrl ctrl = null;
+ switch(game.config.gameMode) {
+ case SOLO:
+ ctrl = new Solo(game, game.config.battle);
+ break;
+ }
+ return ctrl;
+ }
+
public Ctrl(final RustAndDust game, final Battle battle)
{
game.ctrl = this;
diff --git a/core/src/ch/asynk/rustanddust/screens/GameScreen.java b/core/src/ch/asynk/rustanddust/screens/GameScreen.java
index cc49263..a4c6bd6 100644
--- a/core/src/ch/asynk/rustanddust/screens/GameScreen.java
+++ b/core/src/ch/asynk/rustanddust/screens/GameScreen.java
@@ -19,7 +19,6 @@ import com.badlogic.gdx.math.Vector3;
import ch.asynk.rustanddust.RustAndDust;
import ch.asynk.rustanddust.game.Ctrl;
-import ch.asynk.rustanddust.game.ctrl.Solo;
public class GameScreen implements Screen
{
@@ -59,7 +58,7 @@ public class GameScreen implements Screen
this.blocked = false;
this.batch = new SpriteBatch();
- this.ctrl = new Solo(game, game.config.battle);
+ this.ctrl = Ctrl.getCtrl(game);
this.cam = new GameCamera(ctrl.map.getWidth(), ctrl.map.getHeight(), ZOOM_OUT_MAX, ZOOM_IN_MAX, game.hudCorrection, FIXED_HUD);
if (DEBUG) this.debugShapes = new ShapeRenderer();