summaryrefslogtreecommitdiffstats
path: root/core/src/ch/asynk/tankontank/screens
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2014-09-17 00:04:21 +0200
committerJérémy Zurcher <jeremy@asynk.ch>2014-09-17 00:04:21 +0200
commit7251086910912202b31a2a2c0318e7869bc1654d (patch)
treeb68836f7a2dcf04b0f3fd4cf966c784131751503 /core/src/ch/asynk/tankontank/screens
parent92c1c362c58f9c86bb0cd203c21422a55766cd0a (diff)
downloadRustAndDust-7251086910912202b31a2a2c0318e7869bc1654d.zip
RustAndDust-7251086910912202b31a2a2c0318e7869bc1654d.tar.gz
merge HexMapFactory and UnitFactory => GameFactory
Diffstat (limited to 'core/src/ch/asynk/tankontank/screens')
-rw-r--r--core/src/ch/asynk/tankontank/screens/GameScreen.java14
1 files changed, 7 insertions, 7 deletions
diff --git a/core/src/ch/asynk/tankontank/screens/GameScreen.java b/core/src/ch/asynk/tankontank/screens/GameScreen.java
index cf946c3..8118489 100644
--- a/core/src/ch/asynk/tankontank/screens/GameScreen.java
+++ b/core/src/ch/asynk/tankontank/screens/GameScreen.java
@@ -25,14 +25,13 @@ import com.badlogic.gdx.utils.viewport.FitViewport;
import com.badlogic.gdx.utils.viewport.ScreenViewport;
import ch.asynk.tankontank.TankOnTank;
+import ch.asynk.tankontank.game.GameFactory;
+import ch.asynk.tankontank.game.GameFactory.UnitType;
import ch.asynk.tankontank.game.Pawn;
import ch.asynk.tankontank.game.HexMap;
import ch.asynk.tankontank.game.Hex;
import ch.asynk.tankontank.game.HexMapImage;
-import ch.asynk.tankontank.game.HexMapFactory;
import ch.asynk.tankontank.game.Unit;
-import ch.asynk.tankontank.game.UnitFactory;
-import ch.asynk.tankontank.game.UnitFactory.UnitType;
public class GameScreen extends AbstractScreen
{
@@ -62,10 +61,12 @@ public class GameScreen extends AbstractScreen
{
super(game);
+ GameFactory.init(game.manager);
+
fps = new Label("FPS: 0", game.skin);
fps.setPosition( 10, Gdx.graphics.getHeight() - 40);
- map = HexMapFactory.getMap(game.manager, HexMapFactory.MapType.MAP_A);
+ map = GameFactory.getMap(game.manager, GameFactory.MapType.MAP_A);
selectedHex = new Image(game.manager.get("images/hex.png", Texture.class));
selectedHex.setVisible(false);
@@ -77,7 +78,6 @@ public class GameScreen extends AbstractScreen
gameStage.addActor((HexMapImage) map);
gameStage.addActor(selectedHex);
- UnitFactory.init(game.manager);
Hex.Orientation o = Hex.Orientation.SOUTH_EAST;
addUnit(gameStage, UnitType.GE_AT_GUN, 1, 4, o);
@@ -106,7 +106,7 @@ public class GameScreen extends AbstractScreen
private void addUnit(Stage stage, UnitType t, int col, int row, Hex.Orientation o)
{
- Unit u = UnitFactory.getUnit(t);
+ Unit u = GameFactory.getUnit(t);
map.setPawnAt((Pawn) u, col, row, o);
stage.addActor(u);
}
@@ -230,7 +230,7 @@ public class GameScreen extends AbstractScreen
Gdx.app.debug("GameScreen", "dispose()");
hud.dispose();
gameStage.dispose();
- UnitFactory.dispose();
+ GameFactory.dispose();
game.unloadAssets();
}