summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2018-10-04 12:43:36 +0200
committerJérémy Zurcher <jeremy@asynk.ch>2018-10-04 12:43:36 +0200
commit88238ad5c3181d008e64c0a80eb144a4b405d8be (patch)
treec03cf02ed9e5c67421ad9c03c97434fa9d09a45c /test
parent6445bd449025a979f436382da90303de3a985d71 (diff)
downloadgdx-boardgame-88238ad5c3181d008e64c0a80eb144a4b405d8be.zip
gdx-boardgame-88238ad5c3181d008e64c0a80eb144a4b405d8be.tar.gz
AbstractScreen : get rid of feed()
Diffstat (limited to 'test')
-rw-r--r--test/src/ch/asynk/gdx/boardgame/test/AbstractScreen.java2
-rw-r--r--test/src/ch/asynk/gdx/boardgame/test/BoardScreen.java12
-rw-r--r--test/src/ch/asynk/gdx/boardgame/test/MenuScreen.java7
-rw-r--r--test/src/ch/asynk/gdx/boardgame/test/UiScreen.java12
4 files changed, 11 insertions, 22 deletions
diff --git a/test/src/ch/asynk/gdx/boardgame/test/AbstractScreen.java b/test/src/ch/asynk/gdx/boardgame/test/AbstractScreen.java
index df0723c..d0929ee 100644
--- a/test/src/ch/asynk/gdx/boardgame/test/AbstractScreen.java
+++ b/test/src/ch/asynk/gdx/boardgame/test/AbstractScreen.java
@@ -36,7 +36,6 @@ public abstract class AbstractScreen implements Screen
protected float inputDelay;
protected boolean paused;
- protected abstract void feed();
public AbstractScreen(final GdxBoardTest app, final String dom)
{
this.app = app;
@@ -45,7 +44,6 @@ public abstract class AbstractScreen implements Screen
this.bg = app.assets.getTexture(app.assets.MAP_00);
this.root = new Root(1);
this.root.setPadding(15);
- feed();
Gdx.input.setInputProcessor(getMultiplexer());
this.inputBlocked = false;
this.inputDelay = 0f;
diff --git a/test/src/ch/asynk/gdx/boardgame/test/BoardScreen.java b/test/src/ch/asynk/gdx/boardgame/test/BoardScreen.java
index 876c2e8..0d7c9fc 100644
--- a/test/src/ch/asynk/gdx/boardgame/test/BoardScreen.java
+++ b/test/src/ch/asynk/gdx/boardgame/test/BoardScreen.java
@@ -137,18 +137,14 @@ public class BoardScreen extends AbstractScreen
}
private State state;
- private Camera cam;
- private MyBoard board;
- private Button btn;
- private Root root;
+ private final Camera cam;
+ private final MyBoard board;
+ private final Button btn;
+ private final Root root;
public BoardScreen(final GdxBoardTest app)
{
super(app, "");
- }
-
- @Override protected void feed()
- {
this.board = new MyBoard(app.assets);
this.camera = this.cam = new Camera(10, board.w, board.h, 1.0f, 0.3f, false);
this.btn = new Button(
diff --git a/test/src/ch/asynk/gdx/boardgame/test/MenuScreen.java b/test/src/ch/asynk/gdx/boardgame/test/MenuScreen.java
index c0052d4..a74b82b 100644
--- a/test/src/ch/asynk/gdx/boardgame/test/MenuScreen.java
+++ b/test/src/ch/asynk/gdx/boardgame/test/MenuScreen.java
@@ -10,16 +10,13 @@ import ch.asynk.gdx.boardgame.ui.Menu;
public class MenuScreen extends AbstractScreen
{
private final float WORLD_RATIO = 0.5f;
- private Sprite corner;
- private Menu menu;
+ private final Sprite corner;
+ private final Menu menu;
public MenuScreen(final GdxBoardTest app)
{
super(app, "MenuScreen");
- }
- @Override protected void feed()
- {
final Assets assets = app.assets;
this.corner = new Sprite(assets.getTexture(assets.CORNER));
diff --git a/test/src/ch/asynk/gdx/boardgame/test/UiScreen.java b/test/src/ch/asynk/gdx/boardgame/test/UiScreen.java
index c2b503b..bfb7b1e 100644
--- a/test/src/ch/asynk/gdx/boardgame/test/UiScreen.java
+++ b/test/src/ch/asynk/gdx/boardgame/test/UiScreen.java
@@ -11,12 +11,7 @@ import ch.asynk.gdx.boardgame.ui.Button;
public class UiScreen extends AbstractScreen
{
private final float WORLD_RATIO = 0.5f;
- private Button hello;
-
- public UiScreen(final GdxBoardTest app)
- {
- super(app, "UiScreen");
- }
+ private final Button hello;
public enum State
{
@@ -33,8 +28,11 @@ public class UiScreen extends AbstractScreen
}
private State state;
- @Override protected void feed()
+
+ public UiScreen(final GdxBoardTest app)
{
+ super(app, "UiScreen");
+
final NinePatch patch = app.assets.getNinePatch(app.assets.PATCH, 23, 23, 23 ,23);
final BitmapFont font = app.assets.getFont(app.assets.FONT_25);