summaryrefslogtreecommitdiffstats
path: root/core/src/ch/asynk/zproject/GdxBoardTest.java
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2018-09-13 19:02:27 +0200
committerJérémy Zurcher <jeremy@asynk.ch>2018-09-13 19:02:27 +0200
commitad423ba369941ebd3f9cced4030291ac67c4b3c6 (patch)
tree73c397867866f80b2ba7f50d7733a0513e46c51b /core/src/ch/asynk/zproject/GdxBoardTest.java
parent7eb1beae9fd79a07783bd850a5d739a9813797dc (diff)
downloadgdx-boardgame-ad423ba369941ebd3f9cced4030291ac67c4b3c6.zip
gdx-boardgame-ad423ba369941ebd3f9cced4030291ac67c4b3c6.tar.gz
namespace desktop -> test, move classes into desktop dir
Diffstat (limited to 'core/src/ch/asynk/zproject/GdxBoardTest.java')
-rw-r--r--core/src/ch/asynk/zproject/GdxBoardTest.java83
1 files changed, 0 insertions, 83 deletions
diff --git a/core/src/ch/asynk/zproject/GdxBoardTest.java b/core/src/ch/asynk/zproject/GdxBoardTest.java
deleted file mode 100644
index 43ff6aa..0000000
--- a/core/src/ch/asynk/zproject/GdxBoardTest.java
+++ /dev/null
@@ -1,83 +0,0 @@
-package ch.asynk.gdx.board;
-
-import com.badlogic.gdx.Game;
-import com.badlogic.gdx.Gdx;
-import com.badlogic.gdx.Screen;
-
-public class GdxBoardTest extends Game
-{
- public static final String DOM = "GdxBoardTest";
-
- private enum State
- {
- NONE,
- LOADING,
- GAME,
- }
- private State state;
-
- public final Assets assets = new Assets();
-
- @Override public void create()
- {
- this.state = State.NONE;
- Gdx.app.setLogLevel(Gdx.app.LOG_DEBUG);
- debug(String.format("create() [%d;%d] %f", Gdx.graphics.getWidth(), Gdx.graphics.getHeight(), Gdx.graphics.getDensity()));
- switchToLoading();
- }
-
- @Override public void dispose()
- {
- switchToNone();
- assets.dispose();
- }
-
- public static void error(String msg)
- {
- Gdx.app.error(DOM, msg);
- }
-
- public static void debug(String msg)
- {
- Gdx.app.debug(DOM, msg);
- }
-
- public static void debug(String from, String msg)
- {
- Gdx.app.debug(DOM, String.format("%s : %s", from, msg));
- }
-
- private void switchTo(Screen nextScreen, State nextState)
- {
- if (state == nextState) {
- error("switch from and to " + state);
- return;
- }
- switch(state) {
- case LOADING: assets.unloadLoading(); break;
- case GAME: assets.unloadGame(); break;
- }
- if (state != State.NONE) {
- getScreen().dispose();
- }
- setScreen(nextScreen);
- this.state = nextState;
- }
-
- public void switchToNone()
- {
- switchTo(null, State.NONE);
- }
-
- public void switchToLoading()
- {
- assets.loadLoading();
- assets.finishLoading();
- switchTo(new LoadingScreen(this, () -> assets.loadGame(), () -> switchToGame()), State.LOADING);
- }
-
- public void switchToGame()
- {
- switchTo(new GameScreen(this), State.GAME);
- }
-}