From 6d2d6942b67afccb0b2024c408f4e963758fc975 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Mon, 15 Sep 2014 23:29:54 +0200 Subject: GameScreen: uses UnitFactory --- core/src/ch/asynk/tankontank/screens/GameScreen.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/core/src/ch/asynk/tankontank/screens/GameScreen.java b/core/src/ch/asynk/tankontank/screens/GameScreen.java index b347741..6762e7d 100644 --- a/core/src/ch/asynk/tankontank/screens/GameScreen.java +++ b/core/src/ch/asynk/tankontank/screens/GameScreen.java @@ -27,6 +27,9 @@ import com.badlogic.gdx.utils.viewport.ScreenViewport; import ch.asynk.tankontank.TankOnTank; import ch.asynk.tankontank.actors.Pawn; import ch.asynk.tankontank.actors.HexMap; +import ch.asynk.tankontank.actors.Unit; +import ch.asynk.tankontank.utils.UnitFactory; +import ch.asynk.tankontank.utils.UnitFactory.UnitType; public class GameScreen extends AbstractScreen { @@ -70,12 +73,21 @@ public class GameScreen extends AbstractScreen gameStage.addActor(map); gameStage.addActor(selectedHex); + UnitFactory.init(game.manager, map); + hud = new Stage(new ScreenViewport()); hud.addActor(fps); Gdx.input.setInputProcessor(getMultiplexer()); } + private void addUnit(Stage stage, UnitType t, int col, int row, int angle) + { + Unit u = UnitFactory.getUnit(t); + u.moveTo(col, row, angle); + stage.addActor(u); + } + private InputMultiplexer getMultiplexer() { final InputMultiplexer multiplexer = new InputMultiplexer(); @@ -193,6 +205,7 @@ public class GameScreen extends AbstractScreen Gdx.app.debug("GameScreen", "dispose()"); hud.dispose(); gameStage.dispose(); + UnitFactory.dispose(); } @Override -- cgit v1.1-2-g2b99