diff --git a/core/src/cz/nic/tablexia/TablexiaApplication.java b/core/src/cz/nic/tablexia/TablexiaApplication.java index 4ba8b2a2e4c01dce641776cc59a4e7eb815aff68..6e6610f0ae44ad07096451eccf3fe169f3e4909c 100644 --- a/core/src/cz/nic/tablexia/TablexiaApplication.java +++ b/core/src/cz/nic/tablexia/TablexiaApplication.java @@ -188,7 +188,7 @@ public abstract class TablexiaApplication implements ApplicationListener { private void processNewScreen(AbstractTablexiaScreen<?> newScreen) { if (newScreen != null) { - inputMultiplexer.addProcessor(newScreen.getStage()); + inputMultiplexer.addProcessor(newScreen.getInputProcessor()); newScreen.show(); newScreen.resize(Gdx.graphics.getWidth(), Gdx.graphics.getHeight()); } @@ -196,7 +196,7 @@ public abstract class TablexiaApplication implements ApplicationListener { private void processLastScreen(AbstractTablexiaScreen<?> lastScreen) { if (lastScreen != null) { - inputMultiplexer.removeProcessor(lastScreen.getStage()); + inputMultiplexer.removeProcessor(lastScreen.getInputProcessor()); lastScreen.hide(); lastScreen.dispose(); lastScreen = null; diff --git a/core/src/cz/nic/tablexia/game/GameDefinition.java b/core/src/cz/nic/tablexia/game/GameDefinition.java index 77ac3663b5cebe451ae33a84e7c2b8e8e3fe147f..aea09575eb3c556f371ea88b1cf43697b86468a5 100644 --- a/core/src/cz/nic/tablexia/game/GameDefinition.java +++ b/core/src/cz/nic/tablexia/game/GameDefinition.java @@ -4,7 +4,7 @@ import cz.nic.tablexia.Tablexia.ChangeScreenEvent; import cz.nic.tablexia.TablexiaApplication.ScreenTransaction; import cz.nic.tablexia.bus.ApplicationBus; import cz.nic.tablexia.bus.ApplicationBus.ApplicationEvent; -import cz.nic.tablexia.game.games.robbery.RuleScreen; +import cz.nic.tablexia.game.games.robbery.RobberyScreen; import cz.nic.tablexia.loader.ApplicationTextManager; import cz.nic.tablexia.menu.IMenuItem; import cz.nic.tablexia.screen.AbstractTablexiaScreen; @@ -12,7 +12,7 @@ import cz.nic.tablexia.screen.AbstractTablexiaScreen; public enum GameDefinition implements ApplicationEvent, IMenuItem { - ROBBERY ("game_robbery_title", RuleScreen.class); + ROBBERY ("game_robbery_title", RobberyScreen.class); private String menuTextKey; private Class<? extends AbstractTablexiaScreen<?>> screenClass; diff --git a/core/src/cz/nic/tablexia/game/games/robbery/DebugScreen.java b/core/src/cz/nic/tablexia/game/games/robbery/DebugScreen.java index 651eb249b438bad961c4ca394cd64af153c5597f..c9d632d1b689d0b318cedffe4703c55b35b22184 100644 --- a/core/src/cz/nic/tablexia/game/games/robbery/DebugScreen.java +++ b/core/src/cz/nic/tablexia/game/games/robbery/DebugScreen.java @@ -7,9 +7,8 @@ import com.badlogic.gdx.graphics.Color; import com.badlogic.gdx.graphics.Texture; import com.badlogic.gdx.scenes.scene2d.Stage; +import cz.nic.tablexia.game.games.robbery.assets.RobberyAssets; import cz.nic.tablexia.game.games.robbery.creature.CreatureRoot; -import cz.nic.tablexia.game.games.robbery.loader.RobberyDataManager; -import cz.nic.tablexia.game.games.robbery.loader.RobberyTextureManager; import cz.nic.tablexia.screen.AbstractTablexiaScreen; import cz.nic.tablexia.util.Log; @@ -41,13 +40,13 @@ public class DebugScreen extends AbstractTablexiaScreen<Void> { @Override protected void screenLoaded() { - displayAllCreatures(RobberyDataManager.getInstance().getResult().getCreatures(), getStage()); + displayAllCreatures(RobberyScreen.getRobberyData().getCreatures(), getStage()); } private void displayAllCreatures(List<CreatureRoot> creatures, Stage stage) { if (creatures != null && creatures.size() > 0) { float creatureScale = 0.5f; - Texture sizeTexture = RobberyTextureManager.getInstance().get(RobberyTextureManager.CREATURE_BACKGROUND_TEXTURE, Texture.class); + Texture sizeTexture = RobberyScreen.getRobberyTexture(RobberyAssets.CREATURE_BACKGROUND_TEXTURE); float creatureWidth = sizeTexture.getWidth() * creatureScale; float creatureHeight = sizeTexture.getHeight() * creatureScale; diff --git a/core/src/cz/nic/tablexia/game/games/robbery/GameScreen.java b/core/src/cz/nic/tablexia/game/games/robbery/GameScreen.java index 307597147a58ad0e1b37f9fdc1376a9863863171..e9dab12f52bfafa44cde28cd4e667015fe20be1e 100644 --- a/core/src/cz/nic/tablexia/game/games/robbery/GameScreen.java +++ b/core/src/cz/nic/tablexia/game/games/robbery/GameScreen.java @@ -23,9 +23,8 @@ import com.badlogic.gdx.scenes.scene2d.InputEvent; import com.badlogic.gdx.scenes.scene2d.InputListener; import com.badlogic.gdx.scenes.scene2d.utils.Align; +import cz.nic.tablexia.game.games.robbery.assets.RobberyAssets; import cz.nic.tablexia.game.games.robbery.creature.CreatureRoot; -import cz.nic.tablexia.game.games.robbery.loader.RobberyDataManager; -import cz.nic.tablexia.game.games.robbery.loader.RobberyTextureManager; import cz.nic.tablexia.screen.AbstractTablexiaScreen; public class GameScreen extends AbstractTablexiaScreen<Void> { @@ -35,7 +34,7 @@ public class GameScreen extends AbstractTablexiaScreen<Void> { private Texture texture; public GameBackground() { - texture = RobberyTextureManager.getInstance().get(RobberyTextureManager.SCREEN_BACKGROUND_S5, Texture.class); + texture = RobberyScreen.getRobberyTexture(RobberyAssets.SCREEN_BACKGROUND_S5); texture.setFilter(TextureFilter.Linear, TextureFilter.Linear); } @@ -53,7 +52,7 @@ public class GameScreen extends AbstractTablexiaScreen<Void> { private Texture texture; public FloorBackground() { - texture = RobberyTextureManager.getInstance().get(RobberyTextureManager.SCREEN_NEWSSTAND_BOTTOM_S5, Texture.class); + texture = RobberyScreen.getRobberyTexture(RobberyAssets.SCREEN_NEWSSTAND_BOTTOM_S5); texture.setFilter(TextureFilter.Linear, TextureFilter.Linear); } @@ -69,7 +68,7 @@ public class GameScreen extends AbstractTablexiaScreen<Void> { private Texture texture; public GameForeground() { - texture = RobberyTextureManager.getInstance().get(RobberyTextureManager.SCREEN_NEWSSTAND_S5, Texture.class); + texture = RobberyScreen.getRobberyTexture(RobberyAssets.SCREEN_NEWSSTAND_S5); texture.setFilter(TextureFilter.Linear, TextureFilter.Linear); } @@ -85,7 +84,7 @@ public class GameScreen extends AbstractTablexiaScreen<Void> { private Texture texture; public GenericInfoItem(String textureName) { - texture = RobberyTextureManager.getInstance().get(textureName, Texture.class); + texture = RobberyScreen.getRobberyTexture(textureName); texture.setFilter(TextureFilter.Linear, TextureFilter.Linear); setSize(texture.getWidth(), texture.getHeight()); } @@ -106,7 +105,7 @@ public class GameScreen extends AbstractTablexiaScreen<Void> { public ColorInfoBanner(Color color) { setColor(color); - texture = RobberyTextureManager.getInstance().get(RobberyTextureManager.CREATURE_BACKGROUND_TEXTURE, Texture.class); + texture = RobberyScreen.getRobberyTexture(RobberyAssets.CREATURE_BACKGROUND_TEXTURE); texture.setFilter(TextureFilter.Linear, TextureFilter.Linear); setSize(texture.getWidth(), texture.getHeight()); } @@ -122,9 +121,9 @@ public class GameScreen extends AbstractTablexiaScreen<Void> { private enum InfoItem { - ARRESTED (new GenericInfoItem(RobberyTextureManager.INFOITEM_ARRESTED), COLOR_OK), - INNOCENCE (new GenericInfoItem(RobberyTextureManager.INFOITEM_INNOCENCE), COLOR_KO), - ALARM (new GenericInfoItem(RobberyTextureManager.INFOITEM_ALARM), null); + ARRESTED (new GenericInfoItem(RobberyAssets.INFOITEM_ARRESTED), COLOR_OK), + INNOCENCE (new GenericInfoItem(RobberyAssets.INFOITEM_INNOCENCE), COLOR_KO), + ALARM (new GenericInfoItem(RobberyAssets.INFOITEM_ALARM), null); private final GenericInfoItem infoItem; private ColorInfoBanner infoBanner; @@ -246,11 +245,17 @@ public class GameScreen extends AbstractTablexiaScreen<Void> { private float creatureFinishPositionY; private int creatureNumber = -1; + private boolean running; + + +//////////////////////////// SCREEN LIFECYCLE @Override public void screenLoaded() { super.show(); + running = false; + getStage().addActor(new GameBackground()); getStage().addActor(colorInfoLayer); getStage().addActor(new FloorBackground()); @@ -260,7 +265,12 @@ public class GameScreen extends AbstractTablexiaScreen<Void> { InfoItem.init(infoItemLayer, colorInfoLayer); prepareCreaturePositions(getStage().getViewport().getWorldWidth(), getStage().getViewport().getWorldHeight()); - showNextCreature(RobberyDataManager.getInstance().getResult().getCreatures()); + } + + @Override + protected void screenVisible() { + running = true; + showNextCreature(RobberyScreen.getRobberyData().getCreatures()); } @Override @@ -269,6 +279,14 @@ public class GameScreen extends AbstractTablexiaScreen<Void> { prepareCreaturePositions(width, height); } + @Override + protected void screenDisposed() { + running = false; + } + + +//////////////////////////// ROBBERY GAME + private int getNumberOfMistakesInGame() { return 0; } @@ -341,7 +359,9 @@ public class GameScreen extends AbstractTablexiaScreen<Void> { InfoItem.ALARM.show(); // getGameManager().setExtraInt2AndSave(getGameManager().getExtraInt2() + 1); } - showNextCreature(creatures); + if (running) { + showNextCreature(creatures); + } } })), run(new Runnable() { @@ -394,5 +414,4 @@ public class GameScreen extends AbstractTablexiaScreen<Void> { // }); } } - } diff --git a/core/src/cz/nic/tablexia/game/games/robbery/RobberyScreen.java b/core/src/cz/nic/tablexia/game/games/robbery/RobberyScreen.java new file mode 100644 index 0000000000000000000000000000000000000000..3a4676d8eb42eb347972b99e9cdcd3b454f0b3c1 --- /dev/null +++ b/core/src/cz/nic/tablexia/game/games/robbery/RobberyScreen.java @@ -0,0 +1,380 @@ +package cz.nic.tablexia.game.games.robbery; + +import static com.badlogic.gdx.scenes.scene2d.actions.Actions.alpha; +import static com.badlogic.gdx.scenes.scene2d.actions.Actions.fadeIn; +import static com.badlogic.gdx.scenes.scene2d.actions.Actions.fadeOut; +import static com.badlogic.gdx.scenes.scene2d.actions.Actions.run; +import static com.badlogic.gdx.scenes.scene2d.actions.Actions.sequence; + +import java.util.List; + +import com.badlogic.gdx.Gdx; +import com.badlogic.gdx.InputMultiplexer; +import com.badlogic.gdx.InputProcessor; +import com.badlogic.gdx.graphics.Color; +import com.badlogic.gdx.graphics.Texture; +import com.badlogic.gdx.graphics.g2d.Batch; +import com.badlogic.gdx.math.Interpolation; +import com.badlogic.gdx.scenes.scene2d.Actor; + +import cz.nic.tablexia.game.common.RandomAccess; +import cz.nic.tablexia.game.difficulty.GameDifficulty; +import cz.nic.tablexia.game.games.robbery.assets.RobberyAssets; +import cz.nic.tablexia.game.games.robbery.creature.CreatureFactory; +import cz.nic.tablexia.game.games.robbery.rules.GameRule; +import cz.nic.tablexia.game.games.robbery.rules.GameRulesDefinition; +import cz.nic.tablexia.graphics.ColorTexture; +import cz.nic.tablexia.loader.CommonAssets; +import cz.nic.tablexia.screen.AbstractTablexiaScreen; + +public class RobberyScreen extends AbstractTablexiaScreen<GameRule> { + + private static int CREATURES_COUNT = 50; + private static int THIEVES_COUNT = 8; + + private static RobberyScreen instance = null; + + private RandomAccess randomAccess = new RandomAccess(); + private GameDifficulty gameDifficulty = GameDifficulty.EASY; + + private InputMultiplexer inputMultiplexer; + private AbstractTablexiaScreen<Void> actualScreen; + private Actor screenDimmer; + + private boolean isRootScreenVisible; + private boolean isComponentScreenVisible; + + +//////////////////////////// SCREEN LOADERS + + @Override + protected void prepareScreenTextureAssetNames(List<String> texturesFileNames) { + texturesFileNames.add(CommonAssets.WOODEN_BACKGOURND); + + texturesFileNames.add(RobberyAssets.SCREEN_RULEMESSAGE_PAPER_S1); + texturesFileNames.add(RobberyAssets.SCREEN_BANK_S1); + texturesFileNames.add(RobberyAssets.SCREEN_NEWSSTAND_S5); + texturesFileNames.add(RobberyAssets.SCREEN_NEWSSTAND_BOTTOM_S5); + texturesFileNames.add(RobberyAssets.SCREEN_BACKGROUND_S5); + + texturesFileNames.add(RobberyAssets.INFOITEM_ARRESTED); + texturesFileNames.add(RobberyAssets.INFOITEM_INNOCENCE); + texturesFileNames.add(RobberyAssets.INFOITEM_ALARM); + + + texturesFileNames.add(RobberyAssets.CREATURE_BACKGROUND_TEXTURE); + + texturesFileNames.add(RobberyAssets.ATTRIBUTE_F_BEADS_BLUE); + texturesFileNames.add(RobberyAssets.ATTRIBUTE_F_BEADS_GREY); + texturesFileNames.add(RobberyAssets.ATTRIBUTE_F_BEADS_RED); + + texturesFileNames.add(RobberyAssets.ATTRIBUTE_F_SCARF_GREEN); + texturesFileNames.add(RobberyAssets.ATTRIBUTE_F_SCARF_PURPLE); + texturesFileNames.add(RobberyAssets.ATTRIBUTE_F_SCARF_YELLOW); + + texturesFileNames.add(RobberyAssets.ATTRIBUTE_M_SCARF_BLUE); + texturesFileNames.add(RobberyAssets.ATTRIBUTE_M_SCARF_BROWN); + texturesFileNames.add(RobberyAssets.ATTRIBUTE_M_SCARF_YELLOW); + + texturesFileNames.add(RobberyAssets.ATTRIBUTE_M_TIE_GREEN); + texturesFileNames.add(RobberyAssets.ATTRIBUTE_M_TIE_GREY); + texturesFileNames.add(RobberyAssets.ATTRIBUTE_M_TIE_RED); + + texturesFileNames.add(RobberyAssets.ATTRIBUTE_F_PANTS_BLUE); + texturesFileNames.add(RobberyAssets.ATTRIBUTE_F_PANTS_BROWN); + texturesFileNames.add(RobberyAssets.ATTRIBUTE_F_PANTS_GREEN); + texturesFileNames.add(RobberyAssets.ATTRIBUTE_F_PANTS_GREY); + texturesFileNames.add(RobberyAssets.ATTRIBUTE_F_PANTS_PURPLE); + texturesFileNames.add(RobberyAssets.ATTRIBUTE_F_PANTS_RED); + + texturesFileNames.add(RobberyAssets.ATTRIBUTE_F_SKIRT_BLUE); + texturesFileNames.add(RobberyAssets.ATTRIBUTE_F_SKIRT_GREEN); + texturesFileNames.add(RobberyAssets.ATTRIBUTE_F_SKIRT_GREY); + texturesFileNames.add(RobberyAssets.ATTRIBUTE_F_SKIRT_PURPLE); + texturesFileNames.add(RobberyAssets.ATTRIBUTE_F_SKIRT_RED); + texturesFileNames.add(RobberyAssets.ATTRIBUTE_F_SKIRT_YELLOW); + + texturesFileNames.add(RobberyAssets.ATTRIBUTE_M_PANTS_BLUE); + texturesFileNames.add(RobberyAssets.ATTRIBUTE_M_PANTS_BROWN); + texturesFileNames.add(RobberyAssets.ATTRIBUTE_M_PANTS_GREEN); + texturesFileNames.add(RobberyAssets.ATTRIBUTE_M_PANTS_GREY); + texturesFileNames.add(RobberyAssets.ATTRIBUTE_M_PANTS_RED); + texturesFileNames.add(RobberyAssets.ATTRIBUTE_M_PANTS_YELLOW); + + texturesFileNames.add(RobberyAssets.ATTRIBUTE_M_SHORT_BLUE); + texturesFileNames.add(RobberyAssets.ATTRIBUTE_M_SHORT_GREEN); + texturesFileNames.add(RobberyAssets.ATTRIBUTE_M_SHORT_GREY); + texturesFileNames.add(RobberyAssets.ATTRIBUTE_M_SHORT_PURPLE); + texturesFileNames.add(RobberyAssets.ATTRIBUTE_M_SHORT_RED); + texturesFileNames.add(RobberyAssets.ATTRIBUTE_M_SHORT_YELLOW); + + texturesFileNames.add(RobberyAssets.ATTRIBUTE_F_HAT_BLUE); + texturesFileNames.add(RobberyAssets.ATTRIBUTE_F_HAT_GREEN); + texturesFileNames.add(RobberyAssets.ATTRIBUTE_F_HAT_GREY); + texturesFileNames.add(RobberyAssets.ATTRIBUTE_F_HAT_PURPLE); + texturesFileNames.add(RobberyAssets.ATTRIBUTE_F_HAT_RED); + texturesFileNames.add(RobberyAssets.ATTRIBUTE_F_HAT_YELLOW); + + texturesFileNames.add(RobberyAssets.ATTRIBUTE_M_HAT_BROWN); + texturesFileNames.add(RobberyAssets.ATTRIBUTE_M_HAT_GREEN); + texturesFileNames.add(RobberyAssets.ATTRIBUTE_M_HAT_GREY); + texturesFileNames.add(RobberyAssets.ATTRIBUTE_M_HAT_PURPLE); + texturesFileNames.add(RobberyAssets.ATTRIBUTE_M_HAT_RED); + texturesFileNames.add(RobberyAssets.ATTRIBUTE_M_HAT_YELLOW); + + texturesFileNames.add(RobberyAssets.ATTRIBUTE_F_COAT_BROWN); + texturesFileNames.add(RobberyAssets.ATTRIBUTE_F_COAT_GREEN); + texturesFileNames.add(RobberyAssets.ATTRIBUTE_F_COAT_GREY); + + texturesFileNames.add(RobberyAssets.ATTRIBUTE_F_SHIRT_BLUE); + texturesFileNames.add(RobberyAssets.ATTRIBUTE_F_SHIRT_GREEN); + texturesFileNames.add(RobberyAssets.ATTRIBUTE_F_SHIRT_GREY); + texturesFileNames.add(RobberyAssets.ATTRIBUTE_F_SHIRT_PURPLE); + texturesFileNames.add(RobberyAssets.ATTRIBUTE_F_SHIRT_RED); + texturesFileNames.add(RobberyAssets.ATTRIBUTE_F_SHIRT_YELLOW); + + texturesFileNames.add(RobberyAssets.ATTRIBUTE_F_SWEATER_BROWN); + texturesFileNames.add(RobberyAssets.ATTRIBUTE_F_SWEATER_GREEN); + texturesFileNames.add(RobberyAssets.ATTRIBUTE_F_SWEATER_GREY); + texturesFileNames.add(RobberyAssets.ATTRIBUTE_F_SWEATER_PURPLE); + texturesFileNames.add(RobberyAssets.ATTRIBUTE_F_SWEATER_RED); + texturesFileNames.add(RobberyAssets.ATTRIBUTE_F_SWEATER_YELLOW); + + texturesFileNames.add(RobberyAssets.ATTRIBUTE_F_VEST_BLUE); + texturesFileNames.add(RobberyAssets.ATTRIBUTE_F_VEST_BROWN); + texturesFileNames.add(RobberyAssets.ATTRIBUTE_F_VEST_GREEN); + texturesFileNames.add(RobberyAssets.ATTRIBUTE_F_VEST_GREY); + texturesFileNames.add(RobberyAssets.ATTRIBUTE_F_VEST_PURPLE); + texturesFileNames.add(RobberyAssets.ATTRIBUTE_F_VEST_YELLOW); + + texturesFileNames.add(RobberyAssets.ATTRIBUTE_M_COAT_BLUE); + texturesFileNames.add(RobberyAssets.ATTRIBUTE_M_COAT_BROWN); + texturesFileNames.add(RobberyAssets.ATTRIBUTE_M_COAT_GREY); + + texturesFileNames.add(RobberyAssets.ATTRIBUTE_M_SHIRT_BLUE); + texturesFileNames.add(RobberyAssets.ATTRIBUTE_M_SHIRT_BROWN); + texturesFileNames.add(RobberyAssets.ATTRIBUTE_M_SHIRT_GREEN); + texturesFileNames.add(RobberyAssets.ATTRIBUTE_M_SHIRT_GREY); + texturesFileNames.add(RobberyAssets.ATTRIBUTE_M_SHIRT_RED); + texturesFileNames.add(RobberyAssets.ATTRIBUTE_M_SHIRT_YELLOW); + + texturesFileNames.add(RobberyAssets.ATTRIBUTE_M_SWEATER_BLUE); + texturesFileNames.add(RobberyAssets.ATTRIBUTE_M_SWEATER_BROWN); + texturesFileNames.add(RobberyAssets.ATTRIBUTE_M_SWEATER_GREEN); + texturesFileNames.add(RobberyAssets.ATTRIBUTE_M_SWEATER_GREY); + texturesFileNames.add(RobberyAssets.ATTRIBUTE_M_SWEATER_RED); + texturesFileNames.add(RobberyAssets.ATTRIBUTE_M_SWEATER_YELLOW); + + texturesFileNames.add(RobberyAssets.ATTRIBUTE_M_VEST_BLUE); + texturesFileNames.add(RobberyAssets.ATTRIBUTE_M_VEST_GREEN); + texturesFileNames.add(RobberyAssets.ATTRIBUTE_M_VEST_GREY); + texturesFileNames.add(RobberyAssets.ATTRIBUTE_M_VEST_PURPLE); + texturesFileNames.add(RobberyAssets.ATTRIBUTE_M_VEST_RED); + texturesFileNames.add(RobberyAssets.ATTRIBUTE_M_VEST_YELLOW); + + texturesFileNames.add(RobberyAssets.ATTRIBUTE_F_GLASSES); + + texturesFileNames.add(RobberyAssets.ATTRIBUTE_M_GLASSES); + + texturesFileNames.add(RobberyAssets.ATTRIBUTE_F_BRAIDHAIR_BLACK); + texturesFileNames.add(RobberyAssets.ATTRIBUTE_F_BRAIDHAIR_BROWN); + texturesFileNames.add(RobberyAssets.ATTRIBUTE_F_BRAIDHAIR_YELLOW); + + texturesFileNames.add(RobberyAssets.ATTRIBUTE_F_LONGHAIR_BLACK); + texturesFileNames.add(RobberyAssets.ATTRIBUTE_F_LONGHAIR_BROWN); + texturesFileNames.add(RobberyAssets.ATTRIBUTE_F_LONGHAIR_YELLOW); + + texturesFileNames.add(RobberyAssets.ATTRIBUTE_M_HAIR_BLACK); + texturesFileNames.add(RobberyAssets.ATTRIBUTE_M_HAIR_BROWN); + texturesFileNames.add(RobberyAssets.ATTRIBUTE_M_HAIR_YELLOW); + + texturesFileNames.add(RobberyAssets.ATTRIBUTE_F_HEAD_1); + texturesFileNames.add(RobberyAssets.ATTRIBUTE_F_HEAD_2); + + texturesFileNames.add(RobberyAssets.ATTRIBUTE_M_HEAD_1); + texturesFileNames.add(RobberyAssets.ATTRIBUTE_M_HEAD_2); + } + + @Override + protected String prepareScreenTextResourcesAssetName() { + return RobberyAssets.TEXT_PATH; + } + + @Override + protected GameRule prepareScreenData() { + GameRulesDefinition rule = GameRulesDefinition.getRandomGameRuleForDifficulty(gameDifficulty, randomAccess.getRandom()); + GameRule gameRule = rule.getGameRuleInstance(randomAccess, CREATURES_COUNT, THIEVES_COUNT); + gameRule.generateCreatures(); + + return gameRule; + } + + +//////////////////////////// INPUT PROCESSOR + + + @Override + public InputProcessor getInputProcessor() { + return inputMultiplexer; + } + + +//////////////////////////// SCREEN LIFECYCLE + + public RobberyScreen() { + instance = this; + isRootScreenVisible = false; + isComponentScreenVisible = false; + inputMultiplexer = new InputMultiplexer(); + } + + @Override + protected void screenLoaded() { + final Texture texture = new ColorTexture(Gdx.graphics.getWidth(), Gdx.graphics.getHeight(), Color.BLACK); + screenDimmer = new Actor(){ + + public void draw(Batch batch, float parentAlpha) { + batch.setColor(getColor()); + batch.draw(texture, 0, 0); + batch.setColor(Color.WHITE); + }; + }; + screenDimmer.addAction(alpha(0)); + getStage().addActor(screenDimmer); + showRuleScreen(false); + } + + @Override + protected void screenVisible() { + isRootScreenVisible = true; + performComponentScreenVisible(); + } + + @Override + public void screenResized(int width, int height) { + if (actualScreen != null) { + actualScreen.resize(width, height); + } + } + + @Override + public void screenRender(float delta) { + if (actualScreen != null) { + actualScreen.render(delta); + } + } + + @Override + protected void screenDisposed() { + actualScreen.dispose(); + CreatureFactory.getInstance().dispose(); + instance = null; + } + + +//////////////////////////// COMPONENT SCREENS + + private void showScreen(final AbstractTablexiaScreen<Void> newScreen, boolean transaction) { + isComponentScreenVisible = false; + if (transaction) { + screenDimmer.addAction(sequence(fadeIn(1, Interpolation.pow4Out), + run(new Runnable() { + + @Override + public void run() { + processNewScreen(newScreen); + } + }), + fadeOut(1, Interpolation.pow4In), + run(new Runnable() { + + @Override + public void run() { + isComponentScreenVisible = true; + performComponentScreenVisible(); + } + }))); + } else { + processNewScreen(newScreen); + isComponentScreenVisible = true; + performComponentScreenVisible(); + } + } + + private void performComponentScreenVisible() { + if (isRootScreenVisible && isComponentScreenVisible) { + isComponentScreenVisible = false; + actualScreen.performScreenVisible(); + } + } + + private void processNewScreen(AbstractTablexiaScreen<Void> newScreen) { + AbstractTablexiaScreen<Void> lastScreen = actualScreen; + actualScreen = newScreen; + inputMultiplexer.addProcessor(newScreen.getInputProcessor()); + newScreen.show(); + if (lastScreen != null) { + inputMultiplexer.removeProcessor(lastScreen.getInputProcessor()); + lastScreen.dispose(); + } + } + + private void showGameScreen(final boolean transaction) { + Gdx.app.postRunnable(new Runnable() { + + @Override + public void run() { + showScreen(new GameScreen(), transaction); + } + }); + } + + private void showRuleScreen(final boolean transaction) { + Gdx.app.postRunnable(new Runnable() { + + @Override + public void run() { + showScreen(new RuleScreen(), transaction); + } + }); + } + + +//////////////////////////// LOADERS ACCESS + + public static Texture getRobberyTexture(String textureName) { + if (instance != null) { + return instance.getTexture(textureName); + } + return null; + } + + public static String getRobberyText(String key) { + if (instance != null) { + return instance.getText(key); + } + return null; + } + + public static String getRobberyFormatedText(String key, Object... args) { + if (instance != null) { + return instance.getFormatedText(key, args); + } + return null; + } + + public static GameRule getRobberyData() { + if (instance != null) { + return instance.getData(); + } + return null; + } + + static void showRobberyRuleScreen() { + instance.showRuleScreen(true); + } + + static void showRobberyGameScreen() { + instance.showGameScreen(true); + } +} diff --git a/core/src/cz/nic/tablexia/game/games/robbery/RuleScreen.java b/core/src/cz/nic/tablexia/game/games/robbery/RuleScreen.java index e4b0f697b84c0929d4410ba86861a8560cb5b5a1..a9bb9761ffd6ff0d50fe9ec74d76e7297a0ecece 100644 --- a/core/src/cz/nic/tablexia/game/games/robbery/RuleScreen.java +++ b/core/src/cz/nic/tablexia/game/games/robbery/RuleScreen.java @@ -1,7 +1,5 @@ package cz.nic.tablexia.game.games.robbery; -import java.util.Locale; - import com.badlogic.gdx.graphics.Color; import com.badlogic.gdx.graphics.Texture; import com.badlogic.gdx.graphics.Texture.TextureFilter; @@ -13,14 +11,7 @@ import com.badlogic.gdx.scenes.scene2d.InputListener; import com.badlogic.gdx.scenes.scene2d.ui.Label; import com.badlogic.gdx.scenes.scene2d.ui.Label.LabelStyle; -import cz.nic.tablexia.Tablexia.ChangeScreenEvent; -import cz.nic.tablexia.TablexiaApplication.ScreenTransaction; -import cz.nic.tablexia.bus.ApplicationBus; -import cz.nic.tablexia.game.common.RandomAccess; -import cz.nic.tablexia.game.difficulty.GameDifficulty; -import cz.nic.tablexia.game.games.robbery.loader.RobberyDataManager; -import cz.nic.tablexia.game.games.robbery.loader.RobberyTextManager; -import cz.nic.tablexia.game.games.robbery.loader.RobberyTextureManager; +import cz.nic.tablexia.game.games.robbery.assets.RobberyAssets; import cz.nic.tablexia.loader.ApplicationFontManager; import cz.nic.tablexia.loader.CommonAssets; import cz.nic.tablexia.screen.AbstractTablexiaScreen; @@ -37,14 +28,13 @@ public class RuleScreen extends AbstractTablexiaScreen<Void> { private Label label; private boolean loadingComplete; - private boolean loadingStart; private class RuleBackground extends Actor { private Texture backgroundTexture; public RuleBackground() { - backgroundTexture = RobberyTextureManager.getInstance().get(CommonAssets.WOODEN_BACKGOURND, Texture.class); + backgroundTexture = RobberyScreen.getRobberyTexture(CommonAssets.WOODEN_BACKGOURND); backgroundTexture.setFilter(TextureFilter.Linear, TextureFilter.Linear); } @@ -64,7 +54,7 @@ public class RuleScreen extends AbstractTablexiaScreen<Void> { private Texture paperTexture; public RulePaper() { - paperTexture = RobberyTextureManager.getInstance().get(RobberyTextureManager.SCREEN_RULEMESSAGE_PAPER_S1, Texture.class); + paperTexture = RobberyScreen.getRobberyTexture(RobberyAssets.SCREEN_RULEMESSAGE_PAPER_S1); paperTexture.setFilter(TextureFilter.Linear, TextureFilter.Linear); } @@ -86,217 +76,26 @@ public class RuleScreen extends AbstractTablexiaScreen<Void> { public RuleScreen() { loadingComplete = false; - loadingStart = false; - } - - @Override - public void screenLoaded() { - super.show(); - - if (!loadingComplete) { - RobberyTextureManager.getInstance().load(); - RobberyTextureManager.getInstance().finishLoading(); - RobberyTextManager.getInstance().load(new Locale("cs", "CZ")); - RobberyDataManager.getInstance().load(GameDifficulty.EASY, new RandomAccess()); - loadingStart = true; - } } - /* - @Override - protected void loadTextures(List<String> texturesFileNames) { - texturesFileNames.add(CommonAssets.WOODEN_BACKGOURND); - - texturesFileNames.add(RobberyTextureManager.SCREEN_RULEMESSAGE_PAPER_S1); - texturesFileNames.add(RobberyTextureManager.SCREEN_BANK_S1); - texturesFileNames.add(RobberyTextureManager.SCREEN_NEWSSTAND_S5); - texturesFileNames.add(RobberyTextureManager.SCREEN_NEWSSTAND_BOTTOM_S5); - texturesFileNames.add(RobberyTextureManager.SCREEN_BACKGROUND_S5); - - texturesFileNames.add(RobberyTextureManager.INFOITEM_ARRESTED); - texturesFileNames.add(RobberyTextureManager.INFOITEM_INNOCENCE); - texturesFileNames.add(RobberyTextureManager.INFOITEM_ALARM); - - - texturesFileNames.add(RobberyTextureManager.CREATURE_BACKGROUND_TEXTURE); - - texturesFileNames.add(RobberyTextureManager.ATTRIBUTE_F_BEADS_BLUE); - texturesFileNames.add(RobberyTextureManager.ATTRIBUTE_F_BEADS_GREY); - texturesFileNames.add(RobberyTextureManager.ATTRIBUTE_F_BEADS_RED); - - texturesFileNames.add(RobberyTextureManager.ATTRIBUTE_F_SCARF_GREEN); - texturesFileNames.add(RobberyTextureManager.ATTRIBUTE_F_SCARF_PURPLE); - texturesFileNames.add(RobberyTextureManager.ATTRIBUTE_F_SCARF_YELLOW); - - texturesFileNames.add(RobberyTextureManager.ATTRIBUTE_M_SCARF_BLUE); - texturesFileNames.add(RobberyTextureManager.ATTRIBUTE_M_SCARF_BROWN); - texturesFileNames.add(RobberyTextureManager.ATTRIBUTE_M_SCARF_YELLOW); - - texturesFileNames.add(RobberyTextureManager.ATTRIBUTE_M_TIE_GREEN); - texturesFileNames.add(RobberyTextureManager.ATTRIBUTE_M_TIE_GREY); - texturesFileNames.add(RobberyTextureManager.ATTRIBUTE_M_TIE_RED); - - texturesFileNames.add(RobberyTextureManager.ATTRIBUTE_F_PANTS_BLUE); - texturesFileNames.add(RobberyTextureManager.ATTRIBUTE_F_PANTS_BROWN); - texturesFileNames.add(RobberyTextureManager.ATTRIBUTE_F_PANTS_GREEN); - texturesFileNames.add(RobberyTextureManager.ATTRIBUTE_F_PANTS_GREY); - texturesFileNames.add(RobberyTextureManager.ATTRIBUTE_F_PANTS_PURPLE); - texturesFileNames.add(RobberyTextureManager.ATTRIBUTE_F_PANTS_RED); - - texturesFileNames.add(RobberyTextureManager.ATTRIBUTE_F_SKIRT_BLUE); - texturesFileNames.add(RobberyTextureManager.ATTRIBUTE_F_SKIRT_GREEN); - texturesFileNames.add(RobberyTextureManager.ATTRIBUTE_F_SKIRT_GREY); - texturesFileNames.add(RobberyTextureManager.ATTRIBUTE_F_SKIRT_PURPLE); - texturesFileNames.add(RobberyTextureManager.ATTRIBUTE_F_SKIRT_RED); - texturesFileNames.add(RobberyTextureManager.ATTRIBUTE_F_SKIRT_YELLOW); - - texturesFileNames.add(RobberyTextureManager.ATTRIBUTE_M_PANTS_BLUE); - texturesFileNames.add(RobberyTextureManager.ATTRIBUTE_M_PANTS_BROWN); - texturesFileNames.add(RobberyTextureManager.ATTRIBUTE_M_PANTS_GREEN); - texturesFileNames.add(RobberyTextureManager.ATTRIBUTE_M_PANTS_GREY); - texturesFileNames.add(RobberyTextureManager.ATTRIBUTE_M_PANTS_RED); - texturesFileNames.add(RobberyTextureManager.ATTRIBUTE_M_PANTS_YELLOW); - - texturesFileNames.add(RobberyTextureManager.ATTRIBUTE_M_SHORT_BLUE); - texturesFileNames.add(RobberyTextureManager.ATTRIBUTE_M_SHORT_GREEN); - texturesFileNames.add(RobberyTextureManager.ATTRIBUTE_M_SHORT_GREY); - texturesFileNames.add(RobberyTextureManager.ATTRIBUTE_M_SHORT_PURPLE); - texturesFileNames.add(RobberyTextureManager.ATTRIBUTE_M_SHORT_RED); - texturesFileNames.add(RobberyTextureManager.ATTRIBUTE_M_SHORT_YELLOW); - - texturesFileNames.add(RobberyTextureManager.ATTRIBUTE_F_HAT_BLUE); - texturesFileNames.add(RobberyTextureManager.ATTRIBUTE_F_HAT_GREEN); - texturesFileNames.add(RobberyTextureManager.ATTRIBUTE_F_HAT_GREY); - texturesFileNames.add(RobberyTextureManager.ATTRIBUTE_F_HAT_PURPLE); - texturesFileNames.add(RobberyTextureManager.ATTRIBUTE_F_HAT_RED); - texturesFileNames.add(RobberyTextureManager.ATTRIBUTE_F_HAT_YELLOW); - - texturesFileNames.add(RobberyTextureManager.ATTRIBUTE_M_HAT_BROWN); - texturesFileNames.add(RobberyTextureManager.ATTRIBUTE_M_HAT_GREEN); - texturesFileNames.add(RobberyTextureManager.ATTRIBUTE_M_HAT_GREY); - texturesFileNames.add(RobberyTextureManager.ATTRIBUTE_M_HAT_PURPLE); - texturesFileNames.add(RobberyTextureManager.ATTRIBUTE_M_HAT_RED); - texturesFileNames.add(RobberyTextureManager.ATTRIBUTE_M_HAT_YELLOW); - - texturesFileNames.add(RobberyTextureManager.ATTRIBUTE_F_COAT_BROWN); - texturesFileNames.add(RobberyTextureManager.ATTRIBUTE_F_COAT_GREEN); - texturesFileNames.add(RobberyTextureManager.ATTRIBUTE_F_COAT_GREY); - - texturesFileNames.add(RobberyTextureManager.ATTRIBUTE_F_SHIRT_BLUE); - texturesFileNames.add(RobberyTextureManager.ATTRIBUTE_F_SHIRT_GREEN); - texturesFileNames.add(RobberyTextureManager.ATTRIBUTE_F_SHIRT_GREY); - texturesFileNames.add(RobberyTextureManager.ATTRIBUTE_F_SHIRT_PURPLE); - texturesFileNames.add(RobberyTextureManager.ATTRIBUTE_F_SHIRT_RED); - texturesFileNames.add(RobberyTextureManager.ATTRIBUTE_F_SHIRT_YELLOW); - - texturesFileNames.add(RobberyTextureManager.ATTRIBUTE_F_SWEATER_BROWN); - texturesFileNames.add(RobberyTextureManager.ATTRIBUTE_F_SWEATER_GREEN); - texturesFileNames.add(RobberyTextureManager.ATTRIBUTE_F_SWEATER_GREY); - texturesFileNames.add(RobberyTextureManager.ATTRIBUTE_F_SWEATER_PURPLE); - texturesFileNames.add(RobberyTextureManager.ATTRIBUTE_F_SWEATER_RED); - texturesFileNames.add(RobberyTextureManager.ATTRIBUTE_F_SWEATER_YELLOW); - - texturesFileNames.add(RobberyTextureManager.ATTRIBUTE_F_VEST_BLUE); - texturesFileNames.add(RobberyTextureManager.ATTRIBUTE_F_VEST_BROWN); - texturesFileNames.add(RobberyTextureManager.ATTRIBUTE_F_VEST_GREEN); - texturesFileNames.add(RobberyTextureManager.ATTRIBUTE_F_VEST_GREY); - texturesFileNames.add(RobberyTextureManager.ATTRIBUTE_F_VEST_PURPLE); - texturesFileNames.add(RobberyTextureManager.ATTRIBUTE_F_VEST_YELLOW); - - texturesFileNames.add(RobberyTextureManager.ATTRIBUTE_M_COAT_BLUE); - texturesFileNames.add(RobberyTextureManager.ATTRIBUTE_M_COAT_BROWN); - texturesFileNames.add(RobberyTextureManager.ATTRIBUTE_M_COAT_GREY); - - texturesFileNames.add(RobberyTextureManager.ATTRIBUTE_M_SHIRT_BLUE); - texturesFileNames.add(RobberyTextureManager.ATTRIBUTE_M_SHIRT_BROWN); - texturesFileNames.add(RobberyTextureManager.ATTRIBUTE_M_SHIRT_GREEN); - texturesFileNames.add(RobberyTextureManager.ATTRIBUTE_M_SHIRT_GREY); - texturesFileNames.add(RobberyTextureManager.ATTRIBUTE_M_SHIRT_RED); - texturesFileNames.add(RobberyTextureManager.ATTRIBUTE_M_SHIRT_YELLOW); - - texturesFileNames.add(RobberyTextureManager.ATTRIBUTE_M_SWEATER_BLUE); - texturesFileNames.add(RobberyTextureManager.ATTRIBUTE_M_SWEATER_BROWN); - texturesFileNames.add(RobberyTextureManager.ATTRIBUTE_M_SWEATER_GREEN); - texturesFileNames.add(RobberyTextureManager.ATTRIBUTE_M_SWEATER_GREY); - texturesFileNames.add(RobberyTextureManager.ATTRIBUTE_M_SWEATER_RED); - texturesFileNames.add(RobberyTextureManager.ATTRIBUTE_M_SWEATER_YELLOW); - - texturesFileNames.add(RobberyTextureManager.ATTRIBUTE_M_VEST_BLUE); - texturesFileNames.add(RobberyTextureManager.ATTRIBUTE_M_VEST_GREEN); - texturesFileNames.add(RobberyTextureManager.ATTRIBUTE_M_VEST_GREY); - texturesFileNames.add(RobberyTextureManager.ATTRIBUTE_M_VEST_PURPLE); - texturesFileNames.add(RobberyTextureManager.ATTRIBUTE_M_VEST_RED); - texturesFileNames.add(RobberyTextureManager.ATTRIBUTE_M_VEST_YELLOW); - - texturesFileNames.add(RobberyTextureManager.ATTRIBUTE_F_GLASSES); - - texturesFileNames.add(RobberyTextureManager.ATTRIBUTE_M_GLASSES); - - texturesFileNames.add(RobberyTextureManager.ATTRIBUTE_F_BRAIDHAIR_BLACK); - texturesFileNames.add(RobberyTextureManager.ATTRIBUTE_F_BRAIDHAIR_BROWN); - texturesFileNames.add(RobberyTextureManager.ATTRIBUTE_F_BRAIDHAIR_YELLOW); - - texturesFileNames.add(RobberyTextureManager.ATTRIBUTE_F_LONGHAIR_BLACK); - texturesFileNames.add(RobberyTextureManager.ATTRIBUTE_F_LONGHAIR_BROWN); - texturesFileNames.add(RobberyTextureManager.ATTRIBUTE_F_LONGHAIR_YELLOW); - - texturesFileNames.add(RobberyTextureManager.ATTRIBUTE_M_HAIR_BLACK); - texturesFileNames.add(RobberyTextureManager.ATTRIBUTE_M_HAIR_BROWN); - texturesFileNames.add(RobberyTextureManager.ATTRIBUTE_M_HAIR_YELLOW); - - texturesFileNames.add(RobberyTextureManager.ATTRIBUTE_F_HEAD_1); - texturesFileNames.add(RobberyTextureManager.ATTRIBUTE_F_HEAD_2); - - texturesFileNames.add(RobberyTextureManager.ATTRIBUTE_M_HEAD_1); - texturesFileNames.add(RobberyTextureManager.ATTRIBUTE_M_HEAD_2); - } - */ - @Override - public void render(float delta) { - super.render(delta); - - if (!loadingComplete && loadingStart) { - if (!RobberyTextManager.getInstance().update()) return; - if (!RobberyDataManager.getInstance().update()) return; - - loadingComplete(); - } - } +//////////////////////////// SCREEN LIFECYCLE @Override - public void screenResized(int width, int height) { - if (loadingComplete) { - background.setSize(width, height); - paper.setSize(width, height); - label.setSize(paper.getWidth() * TEXT_PAPER_WIDTH_RATIO, paper.getHeight() * TEXT_PAPER_HEIGHT_RATIO); - label.setPosition((width / 2) - (label.getWidth() / 2), (height * TEXT_PAPER_POSITION_Y_RATIO) - (label.getHeight() / 2)); - } - } - - @Override - public void screenDisposed() { - //TODO move to gameEnd method - RobberyTextureManager.getInstance().dispose(); - RobberyDataManager.getInstance().dispose(); - RobberyTextManager.getInstance().dispose(); - } - - private void loadingComplete() { + protected void screenLoaded() { background = new RuleBackground(); paper = new RulePaper(); paper.addListener(new InputListener() { @Override public boolean touchDown(InputEvent event, float x, float y, int pointer, int button) { - ApplicationBus.getInstance().publishAsync(new ChangeScreenEvent(GameScreen.class, ScreenTransaction.FADE)); + RobberyScreen.showRobberyGameScreen(); return true; } }); BitmapFont font = ApplicationFontManager.getInstance().<BitmapFont>get(ApplicationFontManager.FONT_ROBOTO_REGULAR); - label = new Label(RobberyDataManager.getInstance().getResult().getRuleMessageText(), - new LabelStyle(font, TEXT_COLOR)); + label = new Label(RobberyScreen.getRobberyData().getRuleMessageText(), new LabelStyle(font, TEXT_COLOR)); label.setWrap(true); getStage().addActor(background); @@ -304,7 +103,15 @@ public class RuleScreen extends AbstractTablexiaScreen<Void> { getStage().addActor(label); loadingComplete = true; - resize((int)getStage().getWidth(), (int)getStage().getHeight()); } - + + @Override + public void screenResized(int width, int height) { + if (loadingComplete) { + background.setSize(width, height); + paper.setSize(width, height); + label.setSize(paper.getWidth() * TEXT_PAPER_WIDTH_RATIO, paper.getHeight() * TEXT_PAPER_HEIGHT_RATIO); + label.setPosition((width / 2) - (label.getWidth() / 2), (height * TEXT_PAPER_POSITION_Y_RATIO) - (label.getHeight() / 2)); + } + } } diff --git a/core/src/cz/nic/tablexia/game/games/robbery/loader/RobberyTextureManager.java b/core/src/cz/nic/tablexia/game/games/robbery/assets/RobberyAssets.java similarity index 62% rename from core/src/cz/nic/tablexia/game/games/robbery/loader/RobberyTextureManager.java rename to core/src/cz/nic/tablexia/game/games/robbery/assets/RobberyAssets.java index 56e39bbf4897d15ac184e9d83b8956714720a8de..8cf79583f7989f45439862b6b09fa7b5630a645b 100644 --- a/core/src/cz/nic/tablexia/game/games/robbery/loader/RobberyTextureManager.java +++ b/core/src/cz/nic/tablexia/game/games/robbery/assets/RobberyAssets.java @@ -1,33 +1,20 @@ -package cz.nic.tablexia.game.games.robbery.loader; -import com.badlogic.gdx.assets.AssetManager; -import com.badlogic.gdx.graphics.Texture; +package cz.nic.tablexia.game.games.robbery.assets; -import cz.nic.tablexia.loader.CommonAssets; -import cz.nic.tablexia.loader.IApplicationLoader; - -public class RobberyTextureManager extends AssetManager implements IApplicationLoader { +public final class RobberyAssets { + + private RobberyAssets() {} - private static RobberyTextureManager instance; - private RobberyTextureManager() {} + public static final String ROBBERY_PATH = "game/robbery/"; - public static RobberyTextureManager getInstance() { - if (instance == null) { - instance = new RobberyTextureManager(); - } - return instance; - } - @Override - public synchronized void dispose() { -// super.dispose(); -// instance = null; - } + public static final String TEXT_PATH = ROBBERY_PATH + "text/robbery"; - public static final String GAME_ROBBERY_GFX_PATH = "game/robbery/gfx/"; - public static final String SCREEN_PATH = GAME_ROBBERY_GFX_PATH + "gamescreen/"; + public static final String ROBBERY_GFX_PATH = "game/robbery/gfx/"; + + public static final String SCREEN_PATH = ROBBERY_GFX_PATH + "gamescreen/"; public static final String SCREEN_RULEMESSAGE_PAPER_S1 = SCREEN_PATH + "game_robbery_rulemessage_paper.png"; @@ -41,7 +28,7 @@ public class RobberyTextureManager extends AssetManager implements IApplicationL public static final String INFOITEM_ALARM = SCREEN_PATH + "thief.png"; - public static final String CREATURE_PATH = GAME_ROBBERY_GFX_PATH + "character/"; + public static final String CREATURE_PATH = ROBBERY_GFX_PATH + "character/"; public static final String CREATURE_BACKGROUND_TEXTURE = CREATURE_PATH + "a_background_white.png"; @@ -174,151 +161,4 @@ public class RobberyTextureManager extends AssetManager implements IApplicationL public static final String ATTRIBUTE_M_HEAD_1 = CREATURE_PATH + "m_head_1.png"; public static final String ATTRIBUTE_M_HEAD_2 = CREATURE_PATH + "m_head_2.png"; - - public void load() { - load(CommonAssets.WOODEN_BACKGOURND, Texture.class); - - load(SCREEN_RULEMESSAGE_PAPER_S1, Texture.class); - load(SCREEN_BANK_S1, Texture.class); - load(SCREEN_NEWSSTAND_S5, Texture.class); - load(SCREEN_NEWSSTAND_BOTTOM_S5, Texture.class); - load(SCREEN_BACKGROUND_S5, Texture.class); - - load(INFOITEM_ARRESTED, Texture.class); - load(INFOITEM_INNOCENCE, Texture.class); - load(INFOITEM_ALARM, Texture.class); - - - load(CREATURE_BACKGROUND_TEXTURE, Texture.class); - - load(ATTRIBUTE_F_BEADS_BLUE, Texture.class); - load(ATTRIBUTE_F_BEADS_GREY, Texture.class); - load(ATTRIBUTE_F_BEADS_RED, Texture.class); - - load(ATTRIBUTE_F_SCARF_GREEN, Texture.class); - load(ATTRIBUTE_F_SCARF_PURPLE, Texture.class); - load(ATTRIBUTE_F_SCARF_YELLOW, Texture.class); - - load(ATTRIBUTE_M_SCARF_BLUE, Texture.class); - load(ATTRIBUTE_M_SCARF_BROWN, Texture.class); - load(ATTRIBUTE_M_SCARF_YELLOW, Texture.class); - - load(ATTRIBUTE_M_TIE_GREEN, Texture.class); - load(ATTRIBUTE_M_TIE_GREY, Texture.class); - load(ATTRIBUTE_M_TIE_RED, Texture.class); - - load(ATTRIBUTE_F_PANTS_BLUE, Texture.class); - load(ATTRIBUTE_F_PANTS_BROWN, Texture.class); - load(ATTRIBUTE_F_PANTS_GREEN, Texture.class); - load(ATTRIBUTE_F_PANTS_GREY, Texture.class); - load(ATTRIBUTE_F_PANTS_PURPLE, Texture.class); - load(ATTRIBUTE_F_PANTS_RED, Texture.class); - - load(ATTRIBUTE_F_SKIRT_BLUE, Texture.class); - load(ATTRIBUTE_F_SKIRT_GREEN, Texture.class); - load(ATTRIBUTE_F_SKIRT_GREY, Texture.class); - load(ATTRIBUTE_F_SKIRT_PURPLE, Texture.class); - load(ATTRIBUTE_F_SKIRT_RED, Texture.class); - load(ATTRIBUTE_F_SKIRT_YELLOW, Texture.class); - - load(ATTRIBUTE_M_PANTS_BLUE, Texture.class); - load(ATTRIBUTE_M_PANTS_BROWN, Texture.class); - load(ATTRIBUTE_M_PANTS_GREEN, Texture.class); - load(ATTRIBUTE_M_PANTS_GREY, Texture.class); - load(ATTRIBUTE_M_PANTS_RED, Texture.class); - load(ATTRIBUTE_M_PANTS_YELLOW, Texture.class); - - load(ATTRIBUTE_M_SHORT_BLUE, Texture.class); - load(ATTRIBUTE_M_SHORT_GREEN, Texture.class); - load(ATTRIBUTE_M_SHORT_GREY, Texture.class); - load(ATTRIBUTE_M_SHORT_PURPLE, Texture.class); - load(ATTRIBUTE_M_SHORT_RED, Texture.class); - load(ATTRIBUTE_M_SHORT_YELLOW, Texture.class); - - load(ATTRIBUTE_F_HAT_BLUE, Texture.class); - load(ATTRIBUTE_F_HAT_GREEN, Texture.class); - load(ATTRIBUTE_F_HAT_GREY, Texture.class); - load(ATTRIBUTE_F_HAT_PURPLE, Texture.class); - load(ATTRIBUTE_F_HAT_RED, Texture.class); - load(ATTRIBUTE_F_HAT_YELLOW, Texture.class); - - load(ATTRIBUTE_M_HAT_BROWN, Texture.class); - load(ATTRIBUTE_M_HAT_GREEN, Texture.class); - load(ATTRIBUTE_M_HAT_GREY, Texture.class); - load(ATTRIBUTE_M_HAT_PURPLE, Texture.class); - load(ATTRIBUTE_M_HAT_RED, Texture.class); - load(ATTRIBUTE_M_HAT_YELLOW, Texture.class); - - load(ATTRIBUTE_F_COAT_BROWN, Texture.class); - load(ATTRIBUTE_F_COAT_GREEN, Texture.class); - load(ATTRIBUTE_F_COAT_GREY, Texture.class); - - load(ATTRIBUTE_F_SHIRT_BLUE, Texture.class); - load(ATTRIBUTE_F_SHIRT_GREEN, Texture.class); - load(ATTRIBUTE_F_SHIRT_GREY, Texture.class); - load(ATTRIBUTE_F_SHIRT_PURPLE, Texture.class); - load(ATTRIBUTE_F_SHIRT_RED, Texture.class); - load(ATTRIBUTE_F_SHIRT_YELLOW, Texture.class); - - load(ATTRIBUTE_F_SWEATER_BROWN, Texture.class); - load(ATTRIBUTE_F_SWEATER_GREEN, Texture.class); - load(ATTRIBUTE_F_SWEATER_GREY, Texture.class); - load(ATTRIBUTE_F_SWEATER_PURPLE, Texture.class); - load(ATTRIBUTE_F_SWEATER_RED, Texture.class); - load(ATTRIBUTE_F_SWEATER_YELLOW, Texture.class); - - load(ATTRIBUTE_F_VEST_BLUE, Texture.class); - load(ATTRIBUTE_F_VEST_BROWN, Texture.class); - load(ATTRIBUTE_F_VEST_GREEN, Texture.class); - load(ATTRIBUTE_F_VEST_GREY, Texture.class); - load(ATTRIBUTE_F_VEST_PURPLE, Texture.class); - load(ATTRIBUTE_F_VEST_YELLOW, Texture.class); - - load(ATTRIBUTE_M_COAT_BLUE, Texture.class); - load(ATTRIBUTE_M_COAT_BROWN, Texture.class); - load(ATTRIBUTE_M_COAT_GREY, Texture.class); - - load(ATTRIBUTE_M_SHIRT_BLUE, Texture.class); - load(ATTRIBUTE_M_SHIRT_BROWN, Texture.class); - load(ATTRIBUTE_M_SHIRT_GREEN, Texture.class); - load(ATTRIBUTE_M_SHIRT_GREY, Texture.class); - load(ATTRIBUTE_M_SHIRT_RED, Texture.class); - load(ATTRIBUTE_M_SHIRT_YELLOW, Texture.class); - - load(ATTRIBUTE_M_SWEATER_BLUE, Texture.class); - load(ATTRIBUTE_M_SWEATER_BROWN, Texture.class); - load(ATTRIBUTE_M_SWEATER_GREEN, Texture.class); - load(ATTRIBUTE_M_SWEATER_GREY, Texture.class); - load(ATTRIBUTE_M_SWEATER_RED, Texture.class); - load(ATTRIBUTE_M_SWEATER_YELLOW, Texture.class); - - load(ATTRIBUTE_M_VEST_BLUE, Texture.class); - load(ATTRIBUTE_M_VEST_GREEN, Texture.class); - load(ATTRIBUTE_M_VEST_GREY, Texture.class); - load(ATTRIBUTE_M_VEST_PURPLE, Texture.class); - load(ATTRIBUTE_M_VEST_RED, Texture.class); - load(ATTRIBUTE_M_VEST_YELLOW, Texture.class); - - load(ATTRIBUTE_F_GLASSES, Texture.class); - - load(ATTRIBUTE_M_GLASSES, Texture.class); - - load(ATTRIBUTE_F_BRAIDHAIR_BLACK, Texture.class); - load(ATTRIBUTE_F_BRAIDHAIR_BROWN, Texture.class); - load(ATTRIBUTE_F_BRAIDHAIR_YELLOW, Texture.class); - - load(ATTRIBUTE_F_LONGHAIR_BLACK, Texture.class); - load(ATTRIBUTE_F_LONGHAIR_BROWN, Texture.class); - load(ATTRIBUTE_F_LONGHAIR_YELLOW, Texture.class); - - load(ATTRIBUTE_M_HAIR_BLACK, Texture.class); - load(ATTRIBUTE_M_HAIR_BROWN, Texture.class); - load(ATTRIBUTE_M_HAIR_YELLOW, Texture.class); - - load(ATTRIBUTE_F_HEAD_1, Texture.class); - load(ATTRIBUTE_F_HEAD_2, Texture.class); - - load(ATTRIBUTE_M_HEAD_1, Texture.class); - load(ATTRIBUTE_M_HEAD_2, Texture.class); - } } \ No newline at end of file diff --git a/core/src/cz/nic/tablexia/game/games/robbery/creature/CreatureFactory.java b/core/src/cz/nic/tablexia/game/games/robbery/creature/CreatureFactory.java index f1ce0d4254ea9625a5d2d35a497485b2339512bb..879c80ec535cebe7e52e3f7fb01e5aab84e51db7 100644 --- a/core/src/cz/nic/tablexia/game/games/robbery/creature/CreatureFactory.java +++ b/core/src/cz/nic/tablexia/game/games/robbery/creature/CreatureFactory.java @@ -18,6 +18,8 @@ ******************************************************************************/ package cz.nic.tablexia.game.games.robbery.creature; +import com.badlogic.gdx.utils.Disposable; + import cz.nic.tablexia.game.common.RandomAccess; import cz.nic.tablexia.game.games.robbery.creature.CreatureRoot.AttributeGender; import cz.nic.tablexia.game.games.robbery.creature.attribute.AttributeDescription; @@ -27,7 +29,7 @@ import cz.nic.tablexia.game.games.robbery.creature.attribute.AttributeDescriptio * * @author Matyáš Latner */ -public class CreatureFactory { +public class CreatureFactory implements Disposable { private static final int GENERATOR_TRY_COUNT = 1000; private static CreatureFactory instance; @@ -38,6 +40,11 @@ public class CreatureFactory { } return instance; } + + @Override + public void dispose() { + instance = null; + } /** * Returns random creature with specific forced description and banned description. diff --git a/core/src/cz/nic/tablexia/game/games/robbery/creature/CreatureRoot.java b/core/src/cz/nic/tablexia/game/games/robbery/creature/CreatureRoot.java index 8a7071dacad76305101f65bc9ebd4a7445a7dfb6..7b00bb43cbc32e12269717d79ada58e0641511a2 100644 --- a/core/src/cz/nic/tablexia/game/games/robbery/creature/CreatureRoot.java +++ b/core/src/cz/nic/tablexia/game/games/robbery/creature/CreatureRoot.java @@ -29,9 +29,11 @@ import com.badlogic.gdx.graphics.Texture.TextureFilter; import com.badlogic.gdx.graphics.g2d.Batch; import com.badlogic.gdx.scenes.scene2d.Actor; +import cz.nic.tablexia.game.games.robbery.RobberyScreen; +import cz.nic.tablexia.game.games.robbery.assets.RobberyAssets; import cz.nic.tablexia.game.games.robbery.creature.attribute.Attribute; -import cz.nic.tablexia.game.games.robbery.creature.attribute.AttributeDescription; import cz.nic.tablexia.game.games.robbery.creature.attribute.Attribute.AttributeColor; +import cz.nic.tablexia.game.games.robbery.creature.attribute.AttributeDescription; import cz.nic.tablexia.game.games.robbery.creature.attribute.clothing.accessories.AccessoriesAttribute; import cz.nic.tablexia.game.games.robbery.creature.attribute.clothing.bottom.BottomAttribute; import cz.nic.tablexia.game.games.robbery.creature.attribute.clothing.headgear.HeadgearAttribute; @@ -39,7 +41,6 @@ import cz.nic.tablexia.game.games.robbery.creature.attribute.clothing.top.TopAtt import cz.nic.tablexia.game.games.robbery.creature.attribute.glasses.GlassesAttribute; import cz.nic.tablexia.game.games.robbery.creature.attribute.hair.HairAttribute; import cz.nic.tablexia.game.games.robbery.creature.attribute.head.HeadAttribute; -import cz.nic.tablexia.game.games.robbery.loader.RobberyTextureManager; /** * Root of creature, defines creature gender @@ -102,7 +103,7 @@ public class CreatureRoot extends Actor { public CreatureRoot(AttributeGender attributeGender, float x, float y) { this.attributeGender = attributeGender; attributes = new ArrayList<Attribute>(); - Texture backgroundTexture = RobberyTextureManager.getInstance().get(RobberyTextureManager.CREATURE_BACKGROUND_TEXTURE, Texture.class); + Texture backgroundTexture = RobberyScreen.getRobberyTexture(RobberyAssets.CREATURE_BACKGROUND_TEXTURE); setBounds(x, y, backgroundTexture.getWidth(), backgroundTexture.getHeight()); } @@ -308,12 +309,12 @@ public class CreatureRoot extends Actor { public void draw(Batch batch, float parentAlpha) { if (highliteColor != null) { batch.setColor(highliteColor.r, highliteColor.g, highliteColor.b, parentAlpha); - Texture texture = RobberyTextureManager.getInstance().get(RobberyTextureManager.CREATURE_BACKGROUND_TEXTURE, Texture.class); + Texture texture = RobberyScreen.getRobberyTexture(RobberyAssets.CREATURE_BACKGROUND_TEXTURE); batch.draw(texture, getX(), getY(), getOriginX(), getOriginY(), getWidth(), getHeight(), getScaleX(), getScaleY(), getRotation(), 0, 0, texture.getWidth(), texture.getHeight(), false, false); batch.setColor(Color.WHITE); } for (Attribute attribute : attributes) { - Texture texture = RobberyTextureManager.getInstance().get(attribute.getTextureName(), Texture.class); + Texture texture = RobberyScreen.getRobberyTexture(attribute.getTextureName()); if(texture.getMinFilter() != TextureFilter.Linear && texture.getMagFilter() != TextureFilter.Linear) { texture.setFilter(TextureFilter.Linear, TextureFilter.Linear); } diff --git a/core/src/cz/nic/tablexia/game/games/robbery/creature/attribute/Attribute.java b/core/src/cz/nic/tablexia/game/games/robbery/creature/attribute/Attribute.java index 38a22b73f14f37970c9e3cc12071a0631fd24fea..887dca68f96717f0e973b8344af9ac2cda5d27ed 100644 --- a/core/src/cz/nic/tablexia/game/games/robbery/creature/attribute/Attribute.java +++ b/core/src/cz/nic/tablexia/game/games/robbery/creature/attribute/Attribute.java @@ -27,17 +27,16 @@ import java.util.List; import java.util.MissingResourceException; import java.util.Random; -import com.badlogic.gdx.utils.I18NBundle; import com.badlogic.gdx.utils.reflect.ClassReflection; import cz.nic.tablexia.game.common.RandomAccess; +import cz.nic.tablexia.game.games.robbery.RobberyScreen; import cz.nic.tablexia.game.games.robbery.creature.CreatureDescriptor; import cz.nic.tablexia.game.games.robbery.creature.CreatureRoot.AttributeGender; import cz.nic.tablexia.game.games.robbery.creature.attribute.clothing.ClothingAttribute; import cz.nic.tablexia.game.games.robbery.creature.attribute.glasses.GlassesAttribute; import cz.nic.tablexia.game.games.robbery.creature.attribute.hair.HairAttribute; import cz.nic.tablexia.game.games.robbery.creature.attribute.head.HeadAttribute; -import cz.nic.tablexia.game.games.robbery.loader.RobberyTextManager; import cz.nic.tablexia.util.Log; /** @@ -215,17 +214,16 @@ public abstract class Attribute { */ public static String getTextDescriptionForAttributeClass(Class<? extends Attribute> attributeClass, boolean useForcedVersion) { String key = STRING_RESOURCE_PREFIX + attributeClass.getSimpleName().toLowerCase(); - I18NBundle bundle = RobberyTextManager.getInstance().getResult(); if (useForcedVersion) { String forcedKey = "_forced"; - try { - bundle.get(forcedKey); + try { + RobberyScreen.getRobberyText(forcedKey); key = forcedKey; } catch (MissingResourceException e) { Log.info(Attribute.class, "Missing forced key: " + forcedKey + " -> Using standart key: " + key); } } - return bundle.get(key); + return RobberyScreen.getRobberyText(key); } /** diff --git a/core/src/cz/nic/tablexia/game/games/robbery/creature/attribute/clothing/accessories/FBeadsAttribute.java b/core/src/cz/nic/tablexia/game/games/robbery/creature/attribute/clothing/accessories/FBeadsAttribute.java index ad6f4ef2c474b4e7060793826f18ff26a9d4ca40..88205fdaae0104162dbdf4fa739a42201cbd3ca2 100644 --- a/core/src/cz/nic/tablexia/game/games/robbery/creature/attribute/clothing/accessories/FBeadsAttribute.java +++ b/core/src/cz/nic/tablexia/game/games/robbery/creature/attribute/clothing/accessories/FBeadsAttribute.java @@ -21,9 +21,9 @@ package cz.nic.tablexia.game.games.robbery.creature.attribute.clothing.accessori import java.util.ArrayList; import java.util.List; +import cz.nic.tablexia.game.games.robbery.assets.RobberyAssets; import cz.nic.tablexia.game.games.robbery.creature.CreatureRoot.AttributeGender; import cz.nic.tablexia.game.games.robbery.creature.attribute.AttributeDescription; -import cz.nic.tablexia.game.games.robbery.loader.RobberyTextureManager; public class FBeadsAttribute extends AccessoriesAttribute { @@ -32,9 +32,9 @@ public class FBeadsAttribute extends AccessoriesAttribute { private static final long serialVersionUID = -5887845485972821477L; { - add(new AttributeDescription(AttributeColor.BLUE, AttributeGender.FEMALE, RobberyTextureManager.ATTRIBUTE_F_BEADS_BLUE, FBeadsAttribute.class)); - add(new AttributeDescription(AttributeColor.GREY, AttributeGender.FEMALE, RobberyTextureManager.ATTRIBUTE_F_BEADS_GREY, FBeadsAttribute.class)); - add(new AttributeDescription(AttributeColor.RED, AttributeGender.FEMALE, RobberyTextureManager.ATTRIBUTE_F_BEADS_RED, FBeadsAttribute.class)); + add(new AttributeDescription(AttributeColor.BLUE, AttributeGender.FEMALE, RobberyAssets.ATTRIBUTE_F_BEADS_BLUE, FBeadsAttribute.class)); + add(new AttributeDescription(AttributeColor.GREY, AttributeGender.FEMALE, RobberyAssets.ATTRIBUTE_F_BEADS_GREY, FBeadsAttribute.class)); + add(new AttributeDescription(AttributeColor.RED, AttributeGender.FEMALE, RobberyAssets.ATTRIBUTE_F_BEADS_RED, FBeadsAttribute.class)); } }; diff --git a/core/src/cz/nic/tablexia/game/games/robbery/creature/attribute/clothing/accessories/FScarfAttribute.java b/core/src/cz/nic/tablexia/game/games/robbery/creature/attribute/clothing/accessories/FScarfAttribute.java index 57735d7b06249b1b7a01b49cc72c7ad114c0c266..fe4654c793923905efa84eb0a4a965e38701ce26 100644 --- a/core/src/cz/nic/tablexia/game/games/robbery/creature/attribute/clothing/accessories/FScarfAttribute.java +++ b/core/src/cz/nic/tablexia/game/games/robbery/creature/attribute/clothing/accessories/FScarfAttribute.java @@ -21,9 +21,9 @@ package cz.nic.tablexia.game.games.robbery.creature.attribute.clothing.accessori import java.util.ArrayList; import java.util.List; +import cz.nic.tablexia.game.games.robbery.assets.RobberyAssets; import cz.nic.tablexia.game.games.robbery.creature.CreatureRoot.AttributeGender; import cz.nic.tablexia.game.games.robbery.creature.attribute.AttributeDescription; -import cz.nic.tablexia.game.games.robbery.loader.RobberyTextureManager; public class FScarfAttribute extends AccessoriesAttribute { @@ -32,9 +32,9 @@ public class FScarfAttribute extends AccessoriesAttribute { private static final long serialVersionUID = 6731353377162453034L; { - add(new AttributeDescription(AttributeColor.GREEN, AttributeGender.FEMALE, RobberyTextureManager.ATTRIBUTE_F_SCARF_GREEN, FScarfAttribute.class)); - add(new AttributeDescription(AttributeColor.PURPLE, AttributeGender.FEMALE, RobberyTextureManager.ATTRIBUTE_F_SCARF_PURPLE, FScarfAttribute.class)); - add(new AttributeDescription(AttributeColor.YELLOW, AttributeGender.FEMALE, RobberyTextureManager.ATTRIBUTE_F_SCARF_YELLOW, FScarfAttribute.class)); + add(new AttributeDescription(AttributeColor.GREEN, AttributeGender.FEMALE, RobberyAssets.ATTRIBUTE_F_SCARF_GREEN, FScarfAttribute.class)); + add(new AttributeDescription(AttributeColor.PURPLE, AttributeGender.FEMALE, RobberyAssets.ATTRIBUTE_F_SCARF_PURPLE, FScarfAttribute.class)); + add(new AttributeDescription(AttributeColor.YELLOW, AttributeGender.FEMALE, RobberyAssets.ATTRIBUTE_F_SCARF_YELLOW, FScarfAttribute.class)); } }; diff --git a/core/src/cz/nic/tablexia/game/games/robbery/creature/attribute/clothing/accessories/MScarfAttribute.java b/core/src/cz/nic/tablexia/game/games/robbery/creature/attribute/clothing/accessories/MScarfAttribute.java index ad78f061ce90358cc3d73e2c87119348dbfd460e..275d6d28af377a40d425247e1bad84f64f0aaa96 100644 --- a/core/src/cz/nic/tablexia/game/games/robbery/creature/attribute/clothing/accessories/MScarfAttribute.java +++ b/core/src/cz/nic/tablexia/game/games/robbery/creature/attribute/clothing/accessories/MScarfAttribute.java @@ -21,9 +21,9 @@ package cz.nic.tablexia.game.games.robbery.creature.attribute.clothing.accessori import java.util.ArrayList; import java.util.List; +import cz.nic.tablexia.game.games.robbery.assets.RobberyAssets; import cz.nic.tablexia.game.games.robbery.creature.CreatureRoot.AttributeGender; import cz.nic.tablexia.game.games.robbery.creature.attribute.AttributeDescription; -import cz.nic.tablexia.game.games.robbery.loader.RobberyTextureManager; public class MScarfAttribute extends AccessoriesAttribute { @@ -32,9 +32,9 @@ public class MScarfAttribute extends AccessoriesAttribute { private static final long serialVersionUID = 6731353377162453034L; { - add(new AttributeDescription(AttributeColor.BLUE, AttributeGender.MALE, RobberyTextureManager.ATTRIBUTE_M_SCARF_BLUE, MScarfAttribute.class)); - add(new AttributeDescription(AttributeColor.BROWN, AttributeGender.MALE, RobberyTextureManager.ATTRIBUTE_M_SCARF_BROWN, MScarfAttribute.class)); - add(new AttributeDescription(AttributeColor.YELLOW, AttributeGender.MALE, RobberyTextureManager.ATTRIBUTE_M_SCARF_YELLOW, MScarfAttribute.class)); + add(new AttributeDescription(AttributeColor.BLUE, AttributeGender.MALE, RobberyAssets.ATTRIBUTE_M_SCARF_BLUE, MScarfAttribute.class)); + add(new AttributeDescription(AttributeColor.BROWN, AttributeGender.MALE, RobberyAssets.ATTRIBUTE_M_SCARF_BROWN, MScarfAttribute.class)); + add(new AttributeDescription(AttributeColor.YELLOW, AttributeGender.MALE, RobberyAssets.ATTRIBUTE_M_SCARF_YELLOW, MScarfAttribute.class)); } }; diff --git a/core/src/cz/nic/tablexia/game/games/robbery/creature/attribute/clothing/accessories/MTieAttribute.java b/core/src/cz/nic/tablexia/game/games/robbery/creature/attribute/clothing/accessories/MTieAttribute.java index 85a7831f7a796416faace7254b3665f59372411d..33abf4b1dac466658a74796bd22f4f82710ee582 100644 --- a/core/src/cz/nic/tablexia/game/games/robbery/creature/attribute/clothing/accessories/MTieAttribute.java +++ b/core/src/cz/nic/tablexia/game/games/robbery/creature/attribute/clothing/accessories/MTieAttribute.java @@ -21,9 +21,9 @@ package cz.nic.tablexia.game.games.robbery.creature.attribute.clothing.accessori import java.util.ArrayList; import java.util.List; +import cz.nic.tablexia.game.games.robbery.assets.RobberyAssets; import cz.nic.tablexia.game.games.robbery.creature.CreatureRoot.AttributeGender; import cz.nic.tablexia.game.games.robbery.creature.attribute.AttributeDescription; -import cz.nic.tablexia.game.games.robbery.loader.RobberyTextureManager; public class MTieAttribute extends AccessoriesAttribute { @@ -32,9 +32,9 @@ public class MTieAttribute extends AccessoriesAttribute { private static final long serialVersionUID = 6731353377162453034L; { - add(new AttributeDescription(AttributeColor.GREEN, AttributeGender.MALE, RobberyTextureManager.ATTRIBUTE_M_TIE_GREEN, MTieAttribute.class)); - add(new AttributeDescription(AttributeColor.GREY, AttributeGender.MALE, RobberyTextureManager.ATTRIBUTE_M_TIE_GREY, MTieAttribute.class)); - add(new AttributeDescription(AttributeColor.RED, AttributeGender.MALE, RobberyTextureManager.ATTRIBUTE_M_TIE_RED, MTieAttribute.class)); + add(new AttributeDescription(AttributeColor.GREEN, AttributeGender.MALE, RobberyAssets.ATTRIBUTE_M_TIE_GREEN, MTieAttribute.class)); + add(new AttributeDescription(AttributeColor.GREY, AttributeGender.MALE, RobberyAssets.ATTRIBUTE_M_TIE_GREY, MTieAttribute.class)); + add(new AttributeDescription(AttributeColor.RED, AttributeGender.MALE, RobberyAssets.ATTRIBUTE_M_TIE_RED, MTieAttribute.class)); } }; diff --git a/core/src/cz/nic/tablexia/game/games/robbery/creature/attribute/clothing/bottom/FPantsAttribute.java b/core/src/cz/nic/tablexia/game/games/robbery/creature/attribute/clothing/bottom/FPantsAttribute.java index 9e5a3aa10f55fa8a383e45b9e70018b12dc2e7fe..0d7e053d8770a3c968be3dcf91621c517ada9e7e 100644 --- a/core/src/cz/nic/tablexia/game/games/robbery/creature/attribute/clothing/bottom/FPantsAttribute.java +++ b/core/src/cz/nic/tablexia/game/games/robbery/creature/attribute/clothing/bottom/FPantsAttribute.java @@ -21,9 +21,9 @@ package cz.nic.tablexia.game.games.robbery.creature.attribute.clothing.bottom; import java.util.ArrayList; import java.util.List; +import cz.nic.tablexia.game.games.robbery.assets.RobberyAssets; import cz.nic.tablexia.game.games.robbery.creature.CreatureRoot.AttributeGender; import cz.nic.tablexia.game.games.robbery.creature.attribute.AttributeDescription; -import cz.nic.tablexia.game.games.robbery.loader.RobberyTextureManager; public class FPantsAttribute extends BottomAttribute { @@ -32,12 +32,12 @@ public class FPantsAttribute extends BottomAttribute { private static final long serialVersionUID = -5887845485972821477L; { - add(new AttributeDescription(AttributeColor.BLUE, AttributeGender.FEMALE, RobberyTextureManager.ATTRIBUTE_F_PANTS_BLUE, FPantsAttribute.class)); - add(new AttributeDescription(AttributeColor.BROWN, AttributeGender.FEMALE, RobberyTextureManager.ATTRIBUTE_F_PANTS_BROWN, FPantsAttribute.class)); - add(new AttributeDescription(AttributeColor.GREEN, AttributeGender.FEMALE, RobberyTextureManager.ATTRIBUTE_F_PANTS_GREEN, FPantsAttribute.class)); - add(new AttributeDescription(AttributeColor.GREY, AttributeGender.FEMALE, RobberyTextureManager.ATTRIBUTE_F_PANTS_GREY, FPantsAttribute.class)); - add(new AttributeDescription(AttributeColor.PURPLE, AttributeGender.FEMALE, RobberyTextureManager.ATTRIBUTE_F_PANTS_PURPLE, FPantsAttribute.class)); - add(new AttributeDescription(AttributeColor.RED, AttributeGender.FEMALE, RobberyTextureManager.ATTRIBUTE_F_PANTS_RED, FPantsAttribute.class)); + add(new AttributeDescription(AttributeColor.BLUE, AttributeGender.FEMALE, RobberyAssets.ATTRIBUTE_F_PANTS_BLUE, FPantsAttribute.class)); + add(new AttributeDescription(AttributeColor.BROWN, AttributeGender.FEMALE, RobberyAssets.ATTRIBUTE_F_PANTS_BROWN, FPantsAttribute.class)); + add(new AttributeDescription(AttributeColor.GREEN, AttributeGender.FEMALE, RobberyAssets.ATTRIBUTE_F_PANTS_GREEN, FPantsAttribute.class)); + add(new AttributeDescription(AttributeColor.GREY, AttributeGender.FEMALE, RobberyAssets.ATTRIBUTE_F_PANTS_GREY, FPantsAttribute.class)); + add(new AttributeDescription(AttributeColor.PURPLE, AttributeGender.FEMALE, RobberyAssets.ATTRIBUTE_F_PANTS_PURPLE, FPantsAttribute.class)); + add(new AttributeDescription(AttributeColor.RED, AttributeGender.FEMALE, RobberyAssets.ATTRIBUTE_F_PANTS_RED, FPantsAttribute.class)); } }; diff --git a/core/src/cz/nic/tablexia/game/games/robbery/creature/attribute/clothing/bottom/FSkirtAttribute.java b/core/src/cz/nic/tablexia/game/games/robbery/creature/attribute/clothing/bottom/FSkirtAttribute.java index 9a5b323693b3e9794d3315f65013ed621b362043..8d14ad29e3e561c9c95d023148910153ee033062 100644 --- a/core/src/cz/nic/tablexia/game/games/robbery/creature/attribute/clothing/bottom/FSkirtAttribute.java +++ b/core/src/cz/nic/tablexia/game/games/robbery/creature/attribute/clothing/bottom/FSkirtAttribute.java @@ -21,9 +21,9 @@ package cz.nic.tablexia.game.games.robbery.creature.attribute.clothing.bottom; import java.util.ArrayList; import java.util.List; +import cz.nic.tablexia.game.games.robbery.assets.RobberyAssets; import cz.nic.tablexia.game.games.robbery.creature.CreatureRoot.AttributeGender; import cz.nic.tablexia.game.games.robbery.creature.attribute.AttributeDescription; -import cz.nic.tablexia.game.games.robbery.loader.RobberyTextureManager; public class FSkirtAttribute extends BottomAttribute { @@ -32,12 +32,12 @@ public class FSkirtAttribute extends BottomAttribute { private static final long serialVersionUID = 1861143602351020835L; { - add(new AttributeDescription(AttributeColor.BLUE, AttributeGender.FEMALE, RobberyTextureManager.ATTRIBUTE_F_SKIRT_BLUE, FSkirtAttribute.class)); - add(new AttributeDescription(AttributeColor.GREEN, AttributeGender.FEMALE, RobberyTextureManager.ATTRIBUTE_F_SKIRT_GREEN, FSkirtAttribute.class)); - add(new AttributeDescription(AttributeColor.GREY, AttributeGender.FEMALE, RobberyTextureManager.ATTRIBUTE_F_SKIRT_GREY, FSkirtAttribute.class)); - add(new AttributeDescription(AttributeColor.PURPLE, AttributeGender.FEMALE, RobberyTextureManager.ATTRIBUTE_F_SKIRT_PURPLE, FSkirtAttribute.class)); - add(new AttributeDescription(AttributeColor.RED, AttributeGender.FEMALE, RobberyTextureManager.ATTRIBUTE_F_SKIRT_RED, FSkirtAttribute.class)); - add(new AttributeDescription(AttributeColor.YELLOW, AttributeGender.FEMALE, RobberyTextureManager.ATTRIBUTE_F_SKIRT_YELLOW, FSkirtAttribute.class)); + add(new AttributeDescription(AttributeColor.BLUE, AttributeGender.FEMALE, RobberyAssets.ATTRIBUTE_F_SKIRT_BLUE, FSkirtAttribute.class)); + add(new AttributeDescription(AttributeColor.GREEN, AttributeGender.FEMALE, RobberyAssets.ATTRIBUTE_F_SKIRT_GREEN, FSkirtAttribute.class)); + add(new AttributeDescription(AttributeColor.GREY, AttributeGender.FEMALE, RobberyAssets.ATTRIBUTE_F_SKIRT_GREY, FSkirtAttribute.class)); + add(new AttributeDescription(AttributeColor.PURPLE, AttributeGender.FEMALE, RobberyAssets.ATTRIBUTE_F_SKIRT_PURPLE, FSkirtAttribute.class)); + add(new AttributeDescription(AttributeColor.RED, AttributeGender.FEMALE, RobberyAssets.ATTRIBUTE_F_SKIRT_RED, FSkirtAttribute.class)); + add(new AttributeDescription(AttributeColor.YELLOW, AttributeGender.FEMALE, RobberyAssets.ATTRIBUTE_F_SKIRT_YELLOW, FSkirtAttribute.class)); } }; diff --git a/core/src/cz/nic/tablexia/game/games/robbery/creature/attribute/clothing/bottom/MPantsAttribute.java b/core/src/cz/nic/tablexia/game/games/robbery/creature/attribute/clothing/bottom/MPantsAttribute.java index cfc5daa046785cded84d872ffcee80024262ac60..96367dfd28eba6c55b297277db6c50ec40456c2c 100644 --- a/core/src/cz/nic/tablexia/game/games/robbery/creature/attribute/clothing/bottom/MPantsAttribute.java +++ b/core/src/cz/nic/tablexia/game/games/robbery/creature/attribute/clothing/bottom/MPantsAttribute.java @@ -21,9 +21,9 @@ package cz.nic.tablexia.game.games.robbery.creature.attribute.clothing.bottom; import java.util.ArrayList; import java.util.List; +import cz.nic.tablexia.game.games.robbery.assets.RobberyAssets; import cz.nic.tablexia.game.games.robbery.creature.CreatureRoot.AttributeGender; import cz.nic.tablexia.game.games.robbery.creature.attribute.AttributeDescription; -import cz.nic.tablexia.game.games.robbery.loader.RobberyTextureManager; public class MPantsAttribute extends BottomAttribute { @@ -32,12 +32,12 @@ public class MPantsAttribute extends BottomAttribute { private static final long serialVersionUID = -5887845485972821477L; { - add(new AttributeDescription(AttributeColor.BLUE, AttributeGender.MALE, RobberyTextureManager.ATTRIBUTE_M_PANTS_BLUE, MPantsAttribute.class)); - add(new AttributeDescription(AttributeColor.BROWN, AttributeGender.MALE, RobberyTextureManager.ATTRIBUTE_M_PANTS_BROWN, MPantsAttribute.class)); - add(new AttributeDescription(AttributeColor.GREEN, AttributeGender.MALE, RobberyTextureManager.ATTRIBUTE_M_PANTS_GREEN, MPantsAttribute.class)); - add(new AttributeDescription(AttributeColor.GREY, AttributeGender.MALE, RobberyTextureManager.ATTRIBUTE_M_PANTS_GREY, MPantsAttribute.class)); - add(new AttributeDescription(AttributeColor.RED, AttributeGender.MALE, RobberyTextureManager.ATTRIBUTE_M_PANTS_RED, MPantsAttribute.class)); - add(new AttributeDescription(AttributeColor.YELLOW, AttributeGender.MALE, RobberyTextureManager.ATTRIBUTE_M_PANTS_YELLOW, MPantsAttribute.class)); + add(new AttributeDescription(AttributeColor.BLUE, AttributeGender.MALE, RobberyAssets.ATTRIBUTE_M_PANTS_BLUE, MPantsAttribute.class)); + add(new AttributeDescription(AttributeColor.BROWN, AttributeGender.MALE, RobberyAssets.ATTRIBUTE_M_PANTS_BROWN, MPantsAttribute.class)); + add(new AttributeDescription(AttributeColor.GREEN, AttributeGender.MALE, RobberyAssets.ATTRIBUTE_M_PANTS_GREEN, MPantsAttribute.class)); + add(new AttributeDescription(AttributeColor.GREY, AttributeGender.MALE, RobberyAssets.ATTRIBUTE_M_PANTS_GREY, MPantsAttribute.class)); + add(new AttributeDescription(AttributeColor.RED, AttributeGender.MALE, RobberyAssets.ATTRIBUTE_M_PANTS_RED, MPantsAttribute.class)); + add(new AttributeDescription(AttributeColor.YELLOW, AttributeGender.MALE, RobberyAssets.ATTRIBUTE_M_PANTS_YELLOW, MPantsAttribute.class)); } }; diff --git a/core/src/cz/nic/tablexia/game/games/robbery/creature/attribute/clothing/bottom/MShortsAttribute.java b/core/src/cz/nic/tablexia/game/games/robbery/creature/attribute/clothing/bottom/MShortsAttribute.java index 39fb435df6afda18957189ee88864a70a829b606..dc55a1bee43780ca5d092a97b248eca05afe1cf6 100644 --- a/core/src/cz/nic/tablexia/game/games/robbery/creature/attribute/clothing/bottom/MShortsAttribute.java +++ b/core/src/cz/nic/tablexia/game/games/robbery/creature/attribute/clothing/bottom/MShortsAttribute.java @@ -21,9 +21,9 @@ package cz.nic.tablexia.game.games.robbery.creature.attribute.clothing.bottom; import java.util.ArrayList; import java.util.List; +import cz.nic.tablexia.game.games.robbery.assets.RobberyAssets; import cz.nic.tablexia.game.games.robbery.creature.CreatureRoot.AttributeGender; import cz.nic.tablexia.game.games.robbery.creature.attribute.AttributeDescription; -import cz.nic.tablexia.game.games.robbery.loader.RobberyTextureManager; public class MShortsAttribute extends BottomAttribute { @@ -32,12 +32,12 @@ public class MShortsAttribute extends BottomAttribute { private static final long serialVersionUID = -5887845485972821477L; { - add(new AttributeDescription(AttributeColor.BLUE, AttributeGender.MALE, RobberyTextureManager.ATTRIBUTE_M_SHORT_BLUE, MShortsAttribute.class)); - add(new AttributeDescription(AttributeColor.GREEN, AttributeGender.MALE, RobberyTextureManager.ATTRIBUTE_M_SHORT_GREEN, MShortsAttribute.class)); - add(new AttributeDescription(AttributeColor.GREY, AttributeGender.MALE, RobberyTextureManager.ATTRIBUTE_M_SHORT_GREY, MShortsAttribute.class)); - add(new AttributeDescription(AttributeColor.PURPLE, AttributeGender.MALE, RobberyTextureManager.ATTRIBUTE_M_SHORT_PURPLE, MShortsAttribute.class)); - add(new AttributeDescription(AttributeColor.RED, AttributeGender.MALE, RobberyTextureManager.ATTRIBUTE_M_SHORT_RED, MShortsAttribute.class)); - add(new AttributeDescription(AttributeColor.YELLOW, AttributeGender.MALE, RobberyTextureManager.ATTRIBUTE_M_SHORT_YELLOW, MShortsAttribute.class)); + add(new AttributeDescription(AttributeColor.BLUE, AttributeGender.MALE, RobberyAssets.ATTRIBUTE_M_SHORT_BLUE, MShortsAttribute.class)); + add(new AttributeDescription(AttributeColor.GREEN, AttributeGender.MALE, RobberyAssets.ATTRIBUTE_M_SHORT_GREEN, MShortsAttribute.class)); + add(new AttributeDescription(AttributeColor.GREY, AttributeGender.MALE, RobberyAssets.ATTRIBUTE_M_SHORT_GREY, MShortsAttribute.class)); + add(new AttributeDescription(AttributeColor.PURPLE, AttributeGender.MALE, RobberyAssets.ATTRIBUTE_M_SHORT_PURPLE, MShortsAttribute.class)); + add(new AttributeDescription(AttributeColor.RED, AttributeGender.MALE, RobberyAssets.ATTRIBUTE_M_SHORT_RED, MShortsAttribute.class)); + add(new AttributeDescription(AttributeColor.YELLOW, AttributeGender.MALE, RobberyAssets.ATTRIBUTE_M_SHORT_YELLOW, MShortsAttribute.class)); } }; diff --git a/core/src/cz/nic/tablexia/game/games/robbery/creature/attribute/clothing/headgear/FHatAttribute.java b/core/src/cz/nic/tablexia/game/games/robbery/creature/attribute/clothing/headgear/FHatAttribute.java index e1863c8329305810bde43a491a8458de553cf341..c5b5b576ced23e5bf34b79b1f3e13762b197f859 100644 --- a/core/src/cz/nic/tablexia/game/games/robbery/creature/attribute/clothing/headgear/FHatAttribute.java +++ b/core/src/cz/nic/tablexia/game/games/robbery/creature/attribute/clothing/headgear/FHatAttribute.java @@ -21,9 +21,9 @@ package cz.nic.tablexia.game.games.robbery.creature.attribute.clothing.headgear; import java.util.ArrayList; import java.util.List; +import cz.nic.tablexia.game.games.robbery.assets.RobberyAssets; import cz.nic.tablexia.game.games.robbery.creature.CreatureRoot.AttributeGender; import cz.nic.tablexia.game.games.robbery.creature.attribute.AttributeDescription; -import cz.nic.tablexia.game.games.robbery.loader.RobberyTextureManager; public class FHatAttribute extends HeadgearAttribute { @@ -32,12 +32,12 @@ public class FHatAttribute extends HeadgearAttribute { private static final long serialVersionUID = 7580714146149497738L; { - add(new AttributeDescription(AttributeColor.BLUE, AttributeGender.FEMALE, RobberyTextureManager.ATTRIBUTE_F_HAT_BLUE, FHatAttribute.class)); - add(new AttributeDescription(AttributeColor.GREEN, AttributeGender.FEMALE, RobberyTextureManager.ATTRIBUTE_F_HAT_GREEN, FHatAttribute.class)); - add(new AttributeDescription(AttributeColor.GREY, AttributeGender.FEMALE, RobberyTextureManager.ATTRIBUTE_F_HAT_GREY, FHatAttribute.class)); - add(new AttributeDescription(AttributeColor.PURPLE, AttributeGender.FEMALE, RobberyTextureManager.ATTRIBUTE_F_HAT_PURPLE, FHatAttribute.class)); - add(new AttributeDescription(AttributeColor.RED, AttributeGender.FEMALE, RobberyTextureManager.ATTRIBUTE_F_HAT_RED, FHatAttribute.class)); - add(new AttributeDescription(AttributeColor.YELLOW, AttributeGender.FEMALE, RobberyTextureManager.ATTRIBUTE_F_HAT_YELLOW, FHatAttribute.class)); + add(new AttributeDescription(AttributeColor.BLUE, AttributeGender.FEMALE, RobberyAssets.ATTRIBUTE_F_HAT_BLUE, FHatAttribute.class)); + add(new AttributeDescription(AttributeColor.GREEN, AttributeGender.FEMALE, RobberyAssets.ATTRIBUTE_F_HAT_GREEN, FHatAttribute.class)); + add(new AttributeDescription(AttributeColor.GREY, AttributeGender.FEMALE, RobberyAssets.ATTRIBUTE_F_HAT_GREY, FHatAttribute.class)); + add(new AttributeDescription(AttributeColor.PURPLE, AttributeGender.FEMALE, RobberyAssets.ATTRIBUTE_F_HAT_PURPLE, FHatAttribute.class)); + add(new AttributeDescription(AttributeColor.RED, AttributeGender.FEMALE, RobberyAssets.ATTRIBUTE_F_HAT_RED, FHatAttribute.class)); + add(new AttributeDescription(AttributeColor.YELLOW, AttributeGender.FEMALE, RobberyAssets.ATTRIBUTE_F_HAT_YELLOW, FHatAttribute.class)); } }; diff --git a/core/src/cz/nic/tablexia/game/games/robbery/creature/attribute/clothing/headgear/MHatAttribute.java b/core/src/cz/nic/tablexia/game/games/robbery/creature/attribute/clothing/headgear/MHatAttribute.java index 642c78ab68960be1a49637580f4ed8625139ad5c..167382cca65c73c19075c2d8edff2d0b9d2e553f 100644 --- a/core/src/cz/nic/tablexia/game/games/robbery/creature/attribute/clothing/headgear/MHatAttribute.java +++ b/core/src/cz/nic/tablexia/game/games/robbery/creature/attribute/clothing/headgear/MHatAttribute.java @@ -21,9 +21,9 @@ package cz.nic.tablexia.game.games.robbery.creature.attribute.clothing.headgear; import java.util.ArrayList; import java.util.List; +import cz.nic.tablexia.game.games.robbery.assets.RobberyAssets; import cz.nic.tablexia.game.games.robbery.creature.CreatureRoot.AttributeGender; import cz.nic.tablexia.game.games.robbery.creature.attribute.AttributeDescription; -import cz.nic.tablexia.game.games.robbery.loader.RobberyTextureManager; public class MHatAttribute extends HeadgearAttribute { @@ -32,12 +32,12 @@ public class MHatAttribute extends HeadgearAttribute { private static final long serialVersionUID = 7580714146149497738L; { - add(new AttributeDescription(AttributeColor.BROWN, AttributeGender.MALE, RobberyTextureManager.ATTRIBUTE_M_HAT_BROWN, MHatAttribute.class)); - add(new AttributeDescription(AttributeColor.GREEN, AttributeGender.MALE, RobberyTextureManager.ATTRIBUTE_M_HAT_GREEN, MHatAttribute.class)); - add(new AttributeDescription(AttributeColor.GREY, AttributeGender.MALE, RobberyTextureManager.ATTRIBUTE_M_HAT_GREY, MHatAttribute.class)); - add(new AttributeDescription(AttributeColor.PURPLE, AttributeGender.MALE, RobberyTextureManager.ATTRIBUTE_M_HAT_PURPLE, MHatAttribute.class)); - add(new AttributeDescription(AttributeColor.RED, AttributeGender.MALE, RobberyTextureManager.ATTRIBUTE_M_HAT_RED, MHatAttribute.class)); - add(new AttributeDescription(AttributeColor.YELLOW, AttributeGender.MALE, RobberyTextureManager.ATTRIBUTE_M_HAT_YELLOW, MHatAttribute.class)); + add(new AttributeDescription(AttributeColor.BROWN, AttributeGender.MALE, RobberyAssets.ATTRIBUTE_M_HAT_BROWN, MHatAttribute.class)); + add(new AttributeDescription(AttributeColor.GREEN, AttributeGender.MALE, RobberyAssets.ATTRIBUTE_M_HAT_GREEN, MHatAttribute.class)); + add(new AttributeDescription(AttributeColor.GREY, AttributeGender.MALE, RobberyAssets.ATTRIBUTE_M_HAT_GREY, MHatAttribute.class)); + add(new AttributeDescription(AttributeColor.PURPLE, AttributeGender.MALE, RobberyAssets.ATTRIBUTE_M_HAT_PURPLE, MHatAttribute.class)); + add(new AttributeDescription(AttributeColor.RED, AttributeGender.MALE, RobberyAssets.ATTRIBUTE_M_HAT_RED, MHatAttribute.class)); + add(new AttributeDescription(AttributeColor.YELLOW, AttributeGender.MALE, RobberyAssets.ATTRIBUTE_M_HAT_YELLOW, MHatAttribute.class)); } }; diff --git a/core/src/cz/nic/tablexia/game/games/robbery/creature/attribute/clothing/top/FCoatAttribute.java b/core/src/cz/nic/tablexia/game/games/robbery/creature/attribute/clothing/top/FCoatAttribute.java index ef77aa6caed67e96a3a5fd1dc3adf1206c39bb71..7edae880ab923d24d6bf877d18dd9c75c31f634a 100644 --- a/core/src/cz/nic/tablexia/game/games/robbery/creature/attribute/clothing/top/FCoatAttribute.java +++ b/core/src/cz/nic/tablexia/game/games/robbery/creature/attribute/clothing/top/FCoatAttribute.java @@ -21,9 +21,9 @@ package cz.nic.tablexia.game.games.robbery.creature.attribute.clothing.top; import java.util.ArrayList; import java.util.List; +import cz.nic.tablexia.game.games.robbery.assets.RobberyAssets; import cz.nic.tablexia.game.games.robbery.creature.CreatureRoot.AttributeGender; import cz.nic.tablexia.game.games.robbery.creature.attribute.AttributeDescription; -import cz.nic.tablexia.game.games.robbery.loader.RobberyTextureManager; public class FCoatAttribute extends TopAttribute { @@ -32,9 +32,9 @@ public class FCoatAttribute extends TopAttribute { private static final long serialVersionUID = 2709780438468185755L; { - add(new AttributeDescription(AttributeColor.BROWN, AttributeGender.FEMALE, RobberyTextureManager.ATTRIBUTE_F_COAT_BROWN, FCoatAttribute.class)); - add(new AttributeDescription(AttributeColor.GREEN, AttributeGender.FEMALE, RobberyTextureManager.ATTRIBUTE_F_COAT_GREEN, FCoatAttribute.class)); - add(new AttributeDescription(AttributeColor.GREY, AttributeGender.FEMALE, RobberyTextureManager.ATTRIBUTE_F_COAT_GREY, FCoatAttribute.class)); + add(new AttributeDescription(AttributeColor.BROWN, AttributeGender.FEMALE, RobberyAssets.ATTRIBUTE_F_COAT_BROWN, FCoatAttribute.class)); + add(new AttributeDescription(AttributeColor.GREEN, AttributeGender.FEMALE, RobberyAssets.ATTRIBUTE_F_COAT_GREEN, FCoatAttribute.class)); + add(new AttributeDescription(AttributeColor.GREY, AttributeGender.FEMALE, RobberyAssets.ATTRIBUTE_F_COAT_GREY, FCoatAttribute.class)); } }; diff --git a/core/src/cz/nic/tablexia/game/games/robbery/creature/attribute/clothing/top/FShirtAttribute.java b/core/src/cz/nic/tablexia/game/games/robbery/creature/attribute/clothing/top/FShirtAttribute.java index 8c3d1da9905e6c5ea416fa0f7c6576bc91c57ece..59ce1124b90f27ec3dbfb118155e7fb255dd751e 100644 --- a/core/src/cz/nic/tablexia/game/games/robbery/creature/attribute/clothing/top/FShirtAttribute.java +++ b/core/src/cz/nic/tablexia/game/games/robbery/creature/attribute/clothing/top/FShirtAttribute.java @@ -21,9 +21,9 @@ package cz.nic.tablexia.game.games.robbery.creature.attribute.clothing.top; import java.util.ArrayList; import java.util.List; +import cz.nic.tablexia.game.games.robbery.assets.RobberyAssets; import cz.nic.tablexia.game.games.robbery.creature.CreatureRoot.AttributeGender; import cz.nic.tablexia.game.games.robbery.creature.attribute.AttributeDescription; -import cz.nic.tablexia.game.games.robbery.loader.RobberyTextureManager; public class FShirtAttribute extends TopAttribute { @@ -32,12 +32,12 @@ public class FShirtAttribute extends TopAttribute { private static final long serialVersionUID = 1614881281381641153L; { - add(new AttributeDescription(AttributeColor.BLUE, AttributeGender.FEMALE, RobberyTextureManager.ATTRIBUTE_F_SHIRT_BLUE, FShirtAttribute.class)); - add(new AttributeDescription(AttributeColor.GREEN, AttributeGender.FEMALE, RobberyTextureManager.ATTRIBUTE_F_SHIRT_GREEN, FShirtAttribute.class)); - add(new AttributeDescription(AttributeColor.GREY, AttributeGender.FEMALE, RobberyTextureManager.ATTRIBUTE_F_SHIRT_GREY, FShirtAttribute.class)); - add(new AttributeDescription(AttributeColor.PURPLE, AttributeGender.FEMALE, RobberyTextureManager.ATTRIBUTE_F_SHIRT_PURPLE, FShirtAttribute.class)); - add(new AttributeDescription(AttributeColor.RED, AttributeGender.FEMALE, RobberyTextureManager.ATTRIBUTE_F_SHIRT_RED, FShirtAttribute.class)); - add(new AttributeDescription(AttributeColor.YELLOW, AttributeGender.FEMALE, RobberyTextureManager.ATTRIBUTE_F_SHIRT_YELLOW, FShirtAttribute.class)); + add(new AttributeDescription(AttributeColor.BLUE, AttributeGender.FEMALE, RobberyAssets.ATTRIBUTE_F_SHIRT_BLUE, FShirtAttribute.class)); + add(new AttributeDescription(AttributeColor.GREEN, AttributeGender.FEMALE, RobberyAssets.ATTRIBUTE_F_SHIRT_GREEN, FShirtAttribute.class)); + add(new AttributeDescription(AttributeColor.GREY, AttributeGender.FEMALE, RobberyAssets.ATTRIBUTE_F_SHIRT_GREY, FShirtAttribute.class)); + add(new AttributeDescription(AttributeColor.PURPLE, AttributeGender.FEMALE, RobberyAssets.ATTRIBUTE_F_SHIRT_PURPLE, FShirtAttribute.class)); + add(new AttributeDescription(AttributeColor.RED, AttributeGender.FEMALE, RobberyAssets.ATTRIBUTE_F_SHIRT_RED, FShirtAttribute.class)); + add(new AttributeDescription(AttributeColor.YELLOW, AttributeGender.FEMALE, RobberyAssets.ATTRIBUTE_F_SHIRT_YELLOW, FShirtAttribute.class)); } }; diff --git a/core/src/cz/nic/tablexia/game/games/robbery/creature/attribute/clothing/top/FSweaterAttribute.java b/core/src/cz/nic/tablexia/game/games/robbery/creature/attribute/clothing/top/FSweaterAttribute.java index 81466b8b22238d6f0b3ab351bb07bd65d33fcacb..646eebb10c0901040d0b5c53806a0d1b97604d5a 100644 --- a/core/src/cz/nic/tablexia/game/games/robbery/creature/attribute/clothing/top/FSweaterAttribute.java +++ b/core/src/cz/nic/tablexia/game/games/robbery/creature/attribute/clothing/top/FSweaterAttribute.java @@ -21,9 +21,9 @@ package cz.nic.tablexia.game.games.robbery.creature.attribute.clothing.top; import java.util.ArrayList; import java.util.List; +import cz.nic.tablexia.game.games.robbery.assets.RobberyAssets; import cz.nic.tablexia.game.games.robbery.creature.CreatureRoot.AttributeGender; import cz.nic.tablexia.game.games.robbery.creature.attribute.AttributeDescription; -import cz.nic.tablexia.game.games.robbery.loader.RobberyTextureManager; public class FSweaterAttribute extends TopAttribute { @@ -32,12 +32,12 @@ public class FSweaterAttribute extends TopAttribute { private static final long serialVersionUID = 1614881281381641153L; { - add(new AttributeDescription(AttributeColor.BROWN, AttributeGender.FEMALE, RobberyTextureManager.ATTRIBUTE_F_SWEATER_BROWN, FSweaterAttribute.class)); - add(new AttributeDescription(AttributeColor.GREEN, AttributeGender.FEMALE, RobberyTextureManager.ATTRIBUTE_F_SWEATER_GREEN, FSweaterAttribute.class)); - add(new AttributeDescription(AttributeColor.GREY, AttributeGender.FEMALE, RobberyTextureManager.ATTRIBUTE_F_SWEATER_GREY, FSweaterAttribute.class)); - add(new AttributeDescription(AttributeColor.PURPLE, AttributeGender.FEMALE, RobberyTextureManager.ATTRIBUTE_F_SWEATER_PURPLE, FSweaterAttribute.class)); - add(new AttributeDescription(AttributeColor.RED, AttributeGender.FEMALE, RobberyTextureManager.ATTRIBUTE_F_SWEATER_RED, FSweaterAttribute.class)); - add(new AttributeDescription(AttributeColor.YELLOW, AttributeGender.FEMALE, RobberyTextureManager.ATTRIBUTE_F_SWEATER_YELLOW, FSweaterAttribute.class)); + add(new AttributeDescription(AttributeColor.BROWN, AttributeGender.FEMALE, RobberyAssets.ATTRIBUTE_F_SWEATER_BROWN, FSweaterAttribute.class)); + add(new AttributeDescription(AttributeColor.GREEN, AttributeGender.FEMALE, RobberyAssets.ATTRIBUTE_F_SWEATER_GREEN, FSweaterAttribute.class)); + add(new AttributeDescription(AttributeColor.GREY, AttributeGender.FEMALE, RobberyAssets.ATTRIBUTE_F_SWEATER_GREY, FSweaterAttribute.class)); + add(new AttributeDescription(AttributeColor.PURPLE, AttributeGender.FEMALE, RobberyAssets.ATTRIBUTE_F_SWEATER_PURPLE, FSweaterAttribute.class)); + add(new AttributeDescription(AttributeColor.RED, AttributeGender.FEMALE, RobberyAssets.ATTRIBUTE_F_SWEATER_RED, FSweaterAttribute.class)); + add(new AttributeDescription(AttributeColor.YELLOW, AttributeGender.FEMALE, RobberyAssets.ATTRIBUTE_F_SWEATER_YELLOW, FSweaterAttribute.class)); } }; diff --git a/core/src/cz/nic/tablexia/game/games/robbery/creature/attribute/clothing/top/FVestAttribute.java b/core/src/cz/nic/tablexia/game/games/robbery/creature/attribute/clothing/top/FVestAttribute.java index 0e20fc07b7639bbda584b27a270fb4c76508c48a..98b25918cd38d8a7aa97020fea8929bdcde10168 100644 --- a/core/src/cz/nic/tablexia/game/games/robbery/creature/attribute/clothing/top/FVestAttribute.java +++ b/core/src/cz/nic/tablexia/game/games/robbery/creature/attribute/clothing/top/FVestAttribute.java @@ -21,9 +21,9 @@ package cz.nic.tablexia.game.games.robbery.creature.attribute.clothing.top; import java.util.ArrayList; import java.util.List; +import cz.nic.tablexia.game.games.robbery.assets.RobberyAssets; import cz.nic.tablexia.game.games.robbery.creature.CreatureRoot.AttributeGender; import cz.nic.tablexia.game.games.robbery.creature.attribute.AttributeDescription; -import cz.nic.tablexia.game.games.robbery.loader.RobberyTextureManager; public class FVestAttribute extends TopAttribute { @@ -32,12 +32,12 @@ public class FVestAttribute extends TopAttribute { private static final long serialVersionUID = 1614881281381641153L; { - add(new AttributeDescription(AttributeColor.BLUE, AttributeGender.FEMALE, RobberyTextureManager.ATTRIBUTE_F_VEST_BLUE, FVestAttribute.class)); - add(new AttributeDescription(AttributeColor.BROWN, AttributeGender.FEMALE, RobberyTextureManager.ATTRIBUTE_F_VEST_BROWN, FVestAttribute.class)); - add(new AttributeDescription(AttributeColor.GREEN, AttributeGender.FEMALE, RobberyTextureManager.ATTRIBUTE_F_VEST_GREEN, FVestAttribute.class)); - add(new AttributeDescription(AttributeColor.GREY, AttributeGender.FEMALE, RobberyTextureManager.ATTRIBUTE_F_VEST_GREY, FVestAttribute.class)); - add(new AttributeDescription(AttributeColor.PURPLE, AttributeGender.FEMALE, RobberyTextureManager.ATTRIBUTE_F_VEST_PURPLE, FVestAttribute.class)); - add(new AttributeDescription(AttributeColor.YELLOW, AttributeGender.FEMALE, RobberyTextureManager.ATTRIBUTE_F_VEST_YELLOW, FVestAttribute.class)); + add(new AttributeDescription(AttributeColor.BLUE, AttributeGender.FEMALE, RobberyAssets.ATTRIBUTE_F_VEST_BLUE, FVestAttribute.class)); + add(new AttributeDescription(AttributeColor.BROWN, AttributeGender.FEMALE, RobberyAssets.ATTRIBUTE_F_VEST_BROWN, FVestAttribute.class)); + add(new AttributeDescription(AttributeColor.GREEN, AttributeGender.FEMALE, RobberyAssets.ATTRIBUTE_F_VEST_GREEN, FVestAttribute.class)); + add(new AttributeDescription(AttributeColor.GREY, AttributeGender.FEMALE, RobberyAssets.ATTRIBUTE_F_VEST_GREY, FVestAttribute.class)); + add(new AttributeDescription(AttributeColor.PURPLE, AttributeGender.FEMALE, RobberyAssets.ATTRIBUTE_F_VEST_PURPLE, FVestAttribute.class)); + add(new AttributeDescription(AttributeColor.YELLOW, AttributeGender.FEMALE, RobberyAssets.ATTRIBUTE_F_VEST_YELLOW, FVestAttribute.class)); } }; diff --git a/core/src/cz/nic/tablexia/game/games/robbery/creature/attribute/clothing/top/MCoatAttribute.java b/core/src/cz/nic/tablexia/game/games/robbery/creature/attribute/clothing/top/MCoatAttribute.java index f1ac8ae1dc9ea584007bc1472a28dc3f3487856f..25fcfdeecd5cbd5625c1ddfdcc14310bd83b8d7c 100644 --- a/core/src/cz/nic/tablexia/game/games/robbery/creature/attribute/clothing/top/MCoatAttribute.java +++ b/core/src/cz/nic/tablexia/game/games/robbery/creature/attribute/clothing/top/MCoatAttribute.java @@ -21,9 +21,9 @@ package cz.nic.tablexia.game.games.robbery.creature.attribute.clothing.top; import java.util.ArrayList; import java.util.List; +import cz.nic.tablexia.game.games.robbery.assets.RobberyAssets; import cz.nic.tablexia.game.games.robbery.creature.CreatureRoot.AttributeGender; import cz.nic.tablexia.game.games.robbery.creature.attribute.AttributeDescription; -import cz.nic.tablexia.game.games.robbery.loader.RobberyTextureManager; public class MCoatAttribute extends TopAttribute { @@ -32,9 +32,9 @@ public class MCoatAttribute extends TopAttribute { private static final long serialVersionUID = 2709780438468185755L; { - add(new AttributeDescription(AttributeColor.BLUE, AttributeGender.MALE, RobberyTextureManager.ATTRIBUTE_M_COAT_BLUE, MCoatAttribute.class)); - add(new AttributeDescription(AttributeColor.BROWN, AttributeGender.MALE, RobberyTextureManager.ATTRIBUTE_M_COAT_BROWN, MCoatAttribute.class)); - add(new AttributeDescription(AttributeColor.GREY, AttributeGender.MALE, RobberyTextureManager.ATTRIBUTE_M_COAT_GREY, MCoatAttribute.class)); + add(new AttributeDescription(AttributeColor.BLUE, AttributeGender.MALE, RobberyAssets.ATTRIBUTE_M_COAT_BLUE, MCoatAttribute.class)); + add(new AttributeDescription(AttributeColor.BROWN, AttributeGender.MALE, RobberyAssets.ATTRIBUTE_M_COAT_BROWN, MCoatAttribute.class)); + add(new AttributeDescription(AttributeColor.GREY, AttributeGender.MALE, RobberyAssets.ATTRIBUTE_M_COAT_GREY, MCoatAttribute.class)); } }; diff --git a/core/src/cz/nic/tablexia/game/games/robbery/creature/attribute/clothing/top/MShirtAttribute.java b/core/src/cz/nic/tablexia/game/games/robbery/creature/attribute/clothing/top/MShirtAttribute.java index f518de3be502b6145616523ef28a8297ada48f49..35cf3a791f3aadd82b81713b9060c5f2bd1d4bef 100644 --- a/core/src/cz/nic/tablexia/game/games/robbery/creature/attribute/clothing/top/MShirtAttribute.java +++ b/core/src/cz/nic/tablexia/game/games/robbery/creature/attribute/clothing/top/MShirtAttribute.java @@ -21,9 +21,9 @@ package cz.nic.tablexia.game.games.robbery.creature.attribute.clothing.top; import java.util.ArrayList; import java.util.List; +import cz.nic.tablexia.game.games.robbery.assets.RobberyAssets; import cz.nic.tablexia.game.games.robbery.creature.CreatureRoot.AttributeGender; import cz.nic.tablexia.game.games.robbery.creature.attribute.AttributeDescription; -import cz.nic.tablexia.game.games.robbery.loader.RobberyTextureManager; public class MShirtAttribute extends TopAttribute { @@ -32,12 +32,12 @@ public class MShirtAttribute extends TopAttribute { private static final long serialVersionUID = 1614881281381641153L; { - add(new AttributeDescription(AttributeColor.BLUE, AttributeGender.MALE, RobberyTextureManager.ATTRIBUTE_M_SHIRT_BLUE, MShirtAttribute.class)); - add(new AttributeDescription(AttributeColor.BROWN, AttributeGender.MALE, RobberyTextureManager.ATTRIBUTE_M_SHIRT_BROWN, MShirtAttribute.class)); - add(new AttributeDescription(AttributeColor.GREEN, AttributeGender.MALE, RobberyTextureManager.ATTRIBUTE_M_SHIRT_GREEN, MShirtAttribute.class)); - add(new AttributeDescription(AttributeColor.GREY, AttributeGender.MALE, RobberyTextureManager.ATTRIBUTE_M_SHIRT_GREY, MShirtAttribute.class)); - add(new AttributeDescription(AttributeColor.RED, AttributeGender.MALE, RobberyTextureManager.ATTRIBUTE_M_SHIRT_RED, MShirtAttribute.class)); - add(new AttributeDescription(AttributeColor.YELLOW, AttributeGender.MALE, RobberyTextureManager.ATTRIBUTE_M_SHIRT_YELLOW, MShirtAttribute.class)); + add(new AttributeDescription(AttributeColor.BLUE, AttributeGender.MALE, RobberyAssets.ATTRIBUTE_M_SHIRT_BLUE, MShirtAttribute.class)); + add(new AttributeDescription(AttributeColor.BROWN, AttributeGender.MALE, RobberyAssets.ATTRIBUTE_M_SHIRT_BROWN, MShirtAttribute.class)); + add(new AttributeDescription(AttributeColor.GREEN, AttributeGender.MALE, RobberyAssets.ATTRIBUTE_M_SHIRT_GREEN, MShirtAttribute.class)); + add(new AttributeDescription(AttributeColor.GREY, AttributeGender.MALE, RobberyAssets.ATTRIBUTE_M_SHIRT_GREY, MShirtAttribute.class)); + add(new AttributeDescription(AttributeColor.RED, AttributeGender.MALE, RobberyAssets.ATTRIBUTE_M_SHIRT_RED, MShirtAttribute.class)); + add(new AttributeDescription(AttributeColor.YELLOW, AttributeGender.MALE, RobberyAssets.ATTRIBUTE_M_SHIRT_YELLOW, MShirtAttribute.class)); } }; diff --git a/core/src/cz/nic/tablexia/game/games/robbery/creature/attribute/clothing/top/MSweaterAttribute.java b/core/src/cz/nic/tablexia/game/games/robbery/creature/attribute/clothing/top/MSweaterAttribute.java index 5471cc2fc95cbdbe6a865011923c8f0f0162cdc4..78cfa99217d2935f6a0aa7490b7620519e7e5a99 100644 --- a/core/src/cz/nic/tablexia/game/games/robbery/creature/attribute/clothing/top/MSweaterAttribute.java +++ b/core/src/cz/nic/tablexia/game/games/robbery/creature/attribute/clothing/top/MSweaterAttribute.java @@ -21,9 +21,9 @@ package cz.nic.tablexia.game.games.robbery.creature.attribute.clothing.top; import java.util.ArrayList; import java.util.List; +import cz.nic.tablexia.game.games.robbery.assets.RobberyAssets; import cz.nic.tablexia.game.games.robbery.creature.CreatureRoot.AttributeGender; import cz.nic.tablexia.game.games.robbery.creature.attribute.AttributeDescription; -import cz.nic.tablexia.game.games.robbery.loader.RobberyTextureManager; public class MSweaterAttribute extends TopAttribute { @@ -32,12 +32,12 @@ public class MSweaterAttribute extends TopAttribute { private static final long serialVersionUID = 1614881281381641153L; { - add(new AttributeDescription(AttributeColor.BLUE, AttributeGender.MALE, RobberyTextureManager.ATTRIBUTE_M_SWEATER_BLUE, MSweaterAttribute.class)); - add(new AttributeDescription(AttributeColor.BROWN, AttributeGender.MALE, RobberyTextureManager.ATTRIBUTE_M_SWEATER_BROWN, MSweaterAttribute.class)); - add(new AttributeDescription(AttributeColor.GREEN, AttributeGender.MALE, RobberyTextureManager.ATTRIBUTE_M_SWEATER_GREEN, MSweaterAttribute.class)); - add(new AttributeDescription(AttributeColor.GREY, AttributeGender.MALE, RobberyTextureManager.ATTRIBUTE_M_SWEATER_GREY, MSweaterAttribute.class)); - add(new AttributeDescription(AttributeColor.RED, AttributeGender.MALE, RobberyTextureManager.ATTRIBUTE_M_SWEATER_RED, MSweaterAttribute.class)); - add(new AttributeDescription(AttributeColor.YELLOW, AttributeGender.MALE, RobberyTextureManager.ATTRIBUTE_M_SWEATER_YELLOW, MSweaterAttribute.class)); + add(new AttributeDescription(AttributeColor.BLUE, AttributeGender.MALE, RobberyAssets.ATTRIBUTE_M_SWEATER_BLUE, MSweaterAttribute.class)); + add(new AttributeDescription(AttributeColor.BROWN, AttributeGender.MALE, RobberyAssets.ATTRIBUTE_M_SWEATER_BROWN, MSweaterAttribute.class)); + add(new AttributeDescription(AttributeColor.GREEN, AttributeGender.MALE, RobberyAssets.ATTRIBUTE_M_SWEATER_GREEN, MSweaterAttribute.class)); + add(new AttributeDescription(AttributeColor.GREY, AttributeGender.MALE, RobberyAssets.ATTRIBUTE_M_SWEATER_GREY, MSweaterAttribute.class)); + add(new AttributeDescription(AttributeColor.RED, AttributeGender.MALE, RobberyAssets.ATTRIBUTE_M_SWEATER_RED, MSweaterAttribute.class)); + add(new AttributeDescription(AttributeColor.YELLOW, AttributeGender.MALE, RobberyAssets.ATTRIBUTE_M_SWEATER_YELLOW, MSweaterAttribute.class)); } }; diff --git a/core/src/cz/nic/tablexia/game/games/robbery/creature/attribute/clothing/top/MVestAttribute.java b/core/src/cz/nic/tablexia/game/games/robbery/creature/attribute/clothing/top/MVestAttribute.java index de1ad8ce234858cac7e7bc940d26668d12b865c8..8372d068a5aed17dcb6a1fa8e6ccd5af2508974e 100644 --- a/core/src/cz/nic/tablexia/game/games/robbery/creature/attribute/clothing/top/MVestAttribute.java +++ b/core/src/cz/nic/tablexia/game/games/robbery/creature/attribute/clothing/top/MVestAttribute.java @@ -21,9 +21,9 @@ package cz.nic.tablexia.game.games.robbery.creature.attribute.clothing.top; import java.util.ArrayList; import java.util.List; +import cz.nic.tablexia.game.games.robbery.assets.RobberyAssets; import cz.nic.tablexia.game.games.robbery.creature.CreatureRoot.AttributeGender; import cz.nic.tablexia.game.games.robbery.creature.attribute.AttributeDescription; -import cz.nic.tablexia.game.games.robbery.loader.RobberyTextureManager; public class MVestAttribute extends TopAttribute { @@ -32,12 +32,12 @@ public class MVestAttribute extends TopAttribute { private static final long serialVersionUID = 1614881281381641153L; { - add(new AttributeDescription(AttributeColor.BLUE, AttributeGender.MALE, RobberyTextureManager.ATTRIBUTE_M_VEST_BLUE, MVestAttribute.class)); - add(new AttributeDescription(AttributeColor.GREEN, AttributeGender.MALE, RobberyTextureManager.ATTRIBUTE_M_VEST_GREEN, MVestAttribute.class)); - add(new AttributeDescription(AttributeColor.GREY, AttributeGender.MALE, RobberyTextureManager.ATTRIBUTE_M_VEST_GREY, MVestAttribute.class)); - add(new AttributeDescription(AttributeColor.PURPLE, AttributeGender.MALE, RobberyTextureManager.ATTRIBUTE_M_VEST_PURPLE, MVestAttribute.class)); - add(new AttributeDescription(AttributeColor.RED, AttributeGender.MALE, RobberyTextureManager.ATTRIBUTE_M_VEST_RED, MVestAttribute.class)); - add(new AttributeDescription(AttributeColor.YELLOW, AttributeGender.MALE, RobberyTextureManager.ATTRIBUTE_M_VEST_YELLOW, MVestAttribute.class)); + add(new AttributeDescription(AttributeColor.BLUE, AttributeGender.MALE, RobberyAssets.ATTRIBUTE_M_VEST_BLUE, MVestAttribute.class)); + add(new AttributeDescription(AttributeColor.GREEN, AttributeGender.MALE, RobberyAssets.ATTRIBUTE_M_VEST_GREEN, MVestAttribute.class)); + add(new AttributeDescription(AttributeColor.GREY, AttributeGender.MALE, RobberyAssets.ATTRIBUTE_M_VEST_GREY, MVestAttribute.class)); + add(new AttributeDescription(AttributeColor.PURPLE, AttributeGender.MALE, RobberyAssets.ATTRIBUTE_M_VEST_PURPLE, MVestAttribute.class)); + add(new AttributeDescription(AttributeColor.RED, AttributeGender.MALE, RobberyAssets.ATTRIBUTE_M_VEST_RED, MVestAttribute.class)); + add(new AttributeDescription(AttributeColor.YELLOW, AttributeGender.MALE, RobberyAssets.ATTRIBUTE_M_VEST_YELLOW, MVestAttribute.class)); } }; diff --git a/core/src/cz/nic/tablexia/game/games/robbery/creature/attribute/glasses/FGlassesAttribute.java b/core/src/cz/nic/tablexia/game/games/robbery/creature/attribute/glasses/FGlassesAttribute.java index c08f646bdfc757b424e6bd6bbbe8d27151b75113..25b107b7659f31bec98b5107f9e0508a91a44bf3 100644 --- a/core/src/cz/nic/tablexia/game/games/robbery/creature/attribute/glasses/FGlassesAttribute.java +++ b/core/src/cz/nic/tablexia/game/games/robbery/creature/attribute/glasses/FGlassesAttribute.java @@ -21,9 +21,9 @@ package cz.nic.tablexia.game.games.robbery.creature.attribute.glasses; import java.util.ArrayList; import java.util.List; +import cz.nic.tablexia.game.games.robbery.assets.RobberyAssets; import cz.nic.tablexia.game.games.robbery.creature.CreatureRoot.AttributeGender; import cz.nic.tablexia.game.games.robbery.creature.attribute.AttributeDescription; -import cz.nic.tablexia.game.games.robbery.loader.RobberyTextureManager; public class FGlassesAttribute extends GlassesAttribute { @@ -32,7 +32,7 @@ public class FGlassesAttribute extends GlassesAttribute { private static final long serialVersionUID = -6497937632464524226L; { - add(new AttributeDescription(null, AttributeGender.FEMALE, RobberyTextureManager.ATTRIBUTE_F_GLASSES, FGlassesAttribute.class)); + add(new AttributeDescription(null, AttributeGender.FEMALE, RobberyAssets.ATTRIBUTE_F_GLASSES, FGlassesAttribute.class)); } }; diff --git a/core/src/cz/nic/tablexia/game/games/robbery/creature/attribute/glasses/MGlassesAttribute.java b/core/src/cz/nic/tablexia/game/games/robbery/creature/attribute/glasses/MGlassesAttribute.java index 2874204077e26f9ff54610b8306bf8cd75800ae8..b89a0a543c801317204367f9601ccdeacadb8801 100644 --- a/core/src/cz/nic/tablexia/game/games/robbery/creature/attribute/glasses/MGlassesAttribute.java +++ b/core/src/cz/nic/tablexia/game/games/robbery/creature/attribute/glasses/MGlassesAttribute.java @@ -21,9 +21,9 @@ package cz.nic.tablexia.game.games.robbery.creature.attribute.glasses; import java.util.ArrayList; import java.util.List; +import cz.nic.tablexia.game.games.robbery.assets.RobberyAssets; import cz.nic.tablexia.game.games.robbery.creature.CreatureRoot.AttributeGender; import cz.nic.tablexia.game.games.robbery.creature.attribute.AttributeDescription; -import cz.nic.tablexia.game.games.robbery.loader.RobberyTextureManager; public class MGlassesAttribute extends GlassesAttribute { @@ -32,7 +32,7 @@ public class MGlassesAttribute extends GlassesAttribute { private static final long serialVersionUID = -8510099403921040383L; { - add(new AttributeDescription(null, AttributeGender.MALE, RobberyTextureManager.ATTRIBUTE_M_GLASSES, MGlassesAttribute.class)); + add(new AttributeDescription(null, AttributeGender.MALE, RobberyAssets.ATTRIBUTE_M_GLASSES, MGlassesAttribute.class)); } }; diff --git a/core/src/cz/nic/tablexia/game/games/robbery/creature/attribute/hair/FBraidhairAttribute.java b/core/src/cz/nic/tablexia/game/games/robbery/creature/attribute/hair/FBraidhairAttribute.java index 1d208ce9f12892523149d5547b70bb868d42ebdd..b21f5bf45a0ac9b9d81e8b258e207b5e507ea2ac 100644 --- a/core/src/cz/nic/tablexia/game/games/robbery/creature/attribute/hair/FBraidhairAttribute.java +++ b/core/src/cz/nic/tablexia/game/games/robbery/creature/attribute/hair/FBraidhairAttribute.java @@ -21,9 +21,9 @@ package cz.nic.tablexia.game.games.robbery.creature.attribute.hair; import java.util.ArrayList; import java.util.List; +import cz.nic.tablexia.game.games.robbery.assets.RobberyAssets; import cz.nic.tablexia.game.games.robbery.creature.CreatureRoot.AttributeGender; import cz.nic.tablexia.game.games.robbery.creature.attribute.AttributeDescription; -import cz.nic.tablexia.game.games.robbery.loader.RobberyTextureManager; public class FBraidhairAttribute extends HairAttribute { @@ -32,9 +32,9 @@ public class FBraidhairAttribute extends HairAttribute { private static final long serialVersionUID = -2566049477108494915L; { - add(new AttributeDescription(AttributeColor.BLACK, AttributeGender.FEMALE, RobberyTextureManager.ATTRIBUTE_F_BRAIDHAIR_BLACK, FBraidhairAttribute.class)); - add(new AttributeDescription(AttributeColor.BROWN, AttributeGender.FEMALE, RobberyTextureManager.ATTRIBUTE_F_BRAIDHAIR_BROWN, FBraidhairAttribute.class)); - add(new AttributeDescription(AttributeColor.YELLOW, AttributeGender.FEMALE, RobberyTextureManager.ATTRIBUTE_F_BRAIDHAIR_YELLOW, FBraidhairAttribute.class)); + add(new AttributeDescription(AttributeColor.BLACK, AttributeGender.FEMALE, RobberyAssets.ATTRIBUTE_F_BRAIDHAIR_BLACK, FBraidhairAttribute.class)); + add(new AttributeDescription(AttributeColor.BROWN, AttributeGender.FEMALE, RobberyAssets.ATTRIBUTE_F_BRAIDHAIR_BROWN, FBraidhairAttribute.class)); + add(new AttributeDescription(AttributeColor.YELLOW, AttributeGender.FEMALE, RobberyAssets.ATTRIBUTE_F_BRAIDHAIR_YELLOW, FBraidhairAttribute.class)); } }; diff --git a/core/src/cz/nic/tablexia/game/games/robbery/creature/attribute/hair/FLonghairAttribute.java b/core/src/cz/nic/tablexia/game/games/robbery/creature/attribute/hair/FLonghairAttribute.java index 5a4c8c5a511604156b05d3be338d10b42a583b5f..c7bc001ce7b4e43c6998082d84900a5f018e1b3e 100644 --- a/core/src/cz/nic/tablexia/game/games/robbery/creature/attribute/hair/FLonghairAttribute.java +++ b/core/src/cz/nic/tablexia/game/games/robbery/creature/attribute/hair/FLonghairAttribute.java @@ -21,9 +21,9 @@ package cz.nic.tablexia.game.games.robbery.creature.attribute.hair; import java.util.ArrayList; import java.util.List; +import cz.nic.tablexia.game.games.robbery.assets.RobberyAssets; import cz.nic.tablexia.game.games.robbery.creature.CreatureRoot.AttributeGender; import cz.nic.tablexia.game.games.robbery.creature.attribute.AttributeDescription; -import cz.nic.tablexia.game.games.robbery.loader.RobberyTextureManager; public class FLonghairAttribute extends HairAttribute { @@ -32,9 +32,9 @@ public class FLonghairAttribute extends HairAttribute { private static final long serialVersionUID = -969047970752296076L; { - add(new AttributeDescription(AttributeColor.BLACK, AttributeGender.FEMALE, RobberyTextureManager.ATTRIBUTE_F_LONGHAIR_BLACK, FLonghairAttribute.class)); - add(new AttributeDescription(AttributeColor.BROWN, AttributeGender.FEMALE, RobberyTextureManager.ATTRIBUTE_F_LONGHAIR_BROWN, FLonghairAttribute.class)); - add(new AttributeDescription(AttributeColor.YELLOW, AttributeGender.FEMALE, RobberyTextureManager.ATTRIBUTE_F_LONGHAIR_YELLOW, FLonghairAttribute.class)); + add(new AttributeDescription(AttributeColor.BLACK, AttributeGender.FEMALE, RobberyAssets.ATTRIBUTE_F_LONGHAIR_BLACK, FLonghairAttribute.class)); + add(new AttributeDescription(AttributeColor.BROWN, AttributeGender.FEMALE, RobberyAssets.ATTRIBUTE_F_LONGHAIR_BROWN, FLonghairAttribute.class)); + add(new AttributeDescription(AttributeColor.YELLOW, AttributeGender.FEMALE, RobberyAssets.ATTRIBUTE_F_LONGHAIR_YELLOW, FLonghairAttribute.class)); } }; diff --git a/core/src/cz/nic/tablexia/game/games/robbery/creature/attribute/hair/MHairAttribute.java b/core/src/cz/nic/tablexia/game/games/robbery/creature/attribute/hair/MHairAttribute.java index 85a2a4dd6d6547cdffe8131d53f281e44e220110..1b724b4e8e2ef9de19038248f1bdc357f0f36a7a 100644 --- a/core/src/cz/nic/tablexia/game/games/robbery/creature/attribute/hair/MHairAttribute.java +++ b/core/src/cz/nic/tablexia/game/games/robbery/creature/attribute/hair/MHairAttribute.java @@ -21,9 +21,9 @@ package cz.nic.tablexia.game.games.robbery.creature.attribute.hair; import java.util.ArrayList; import java.util.List; +import cz.nic.tablexia.game.games.robbery.assets.RobberyAssets; import cz.nic.tablexia.game.games.robbery.creature.CreatureRoot.AttributeGender; import cz.nic.tablexia.game.games.robbery.creature.attribute.AttributeDescription; -import cz.nic.tablexia.game.games.robbery.loader.RobberyTextureManager; public class MHairAttribute extends HairAttribute { @@ -32,9 +32,9 @@ public class MHairAttribute extends HairAttribute { private static final long serialVersionUID = -969047970752296076L; { - add(new AttributeDescription(AttributeColor.BLACK, AttributeGender.MALE, RobberyTextureManager.ATTRIBUTE_M_HAIR_BLACK, MHairAttribute.class)); - add(new AttributeDescription(AttributeColor.BROWN, AttributeGender.MALE, RobberyTextureManager.ATTRIBUTE_M_HAIR_BROWN, MHairAttribute.class)); - add(new AttributeDescription(AttributeColor.YELLOW, AttributeGender.MALE, RobberyTextureManager.ATTRIBUTE_M_HAIR_YELLOW, MHairAttribute.class)); + add(new AttributeDescription(AttributeColor.BLACK, AttributeGender.MALE, RobberyAssets.ATTRIBUTE_M_HAIR_BLACK, MHairAttribute.class)); + add(new AttributeDescription(AttributeColor.BROWN, AttributeGender.MALE, RobberyAssets.ATTRIBUTE_M_HAIR_BROWN, MHairAttribute.class)); + add(new AttributeDescription(AttributeColor.YELLOW, AttributeGender.MALE, RobberyAssets.ATTRIBUTE_M_HAIR_YELLOW, MHairAttribute.class)); } }; diff --git a/core/src/cz/nic/tablexia/game/games/robbery/creature/attribute/head/FHead1Attribute.java b/core/src/cz/nic/tablexia/game/games/robbery/creature/attribute/head/FHead1Attribute.java index 6a6a79bb03f56f8bb3f65f7daeb0256cad71fdcc..d4fdd5c832906b11d5627a9f8897b040cf6d3ea5 100644 --- a/core/src/cz/nic/tablexia/game/games/robbery/creature/attribute/head/FHead1Attribute.java +++ b/core/src/cz/nic/tablexia/game/games/robbery/creature/attribute/head/FHead1Attribute.java @@ -22,9 +22,9 @@ package cz.nic.tablexia.game.games.robbery.creature.attribute.head; import java.util.ArrayList; import java.util.List; +import cz.nic.tablexia.game.games.robbery.assets.RobberyAssets; import cz.nic.tablexia.game.games.robbery.creature.CreatureRoot.AttributeGender; import cz.nic.tablexia.game.games.robbery.creature.attribute.AttributeDescription; -import cz.nic.tablexia.game.games.robbery.loader.RobberyTextureManager; public class FHead1Attribute extends HeadAttribute { @@ -33,7 +33,7 @@ public class FHead1Attribute extends HeadAttribute { private static final long serialVersionUID = 5615637786804769905L; { - add(new AttributeDescription(null, AttributeGender.FEMALE, RobberyTextureManager.ATTRIBUTE_F_HEAD_1, FHead1Attribute.class)); + add(new AttributeDescription(null, AttributeGender.FEMALE, RobberyAssets.ATTRIBUTE_F_HEAD_1, FHead1Attribute.class)); } }; diff --git a/core/src/cz/nic/tablexia/game/games/robbery/creature/attribute/head/FHead2Attribute.java b/core/src/cz/nic/tablexia/game/games/robbery/creature/attribute/head/FHead2Attribute.java index b8c6aa709166513907de037247a813219ce97acc..335e108500c81d3f24bc042a10159a2bf46bc4b1 100644 --- a/core/src/cz/nic/tablexia/game/games/robbery/creature/attribute/head/FHead2Attribute.java +++ b/core/src/cz/nic/tablexia/game/games/robbery/creature/attribute/head/FHead2Attribute.java @@ -21,9 +21,9 @@ package cz.nic.tablexia.game.games.robbery.creature.attribute.head; import java.util.ArrayList; import java.util.List; +import cz.nic.tablexia.game.games.robbery.assets.RobberyAssets; import cz.nic.tablexia.game.games.robbery.creature.CreatureRoot.AttributeGender; import cz.nic.tablexia.game.games.robbery.creature.attribute.AttributeDescription; -import cz.nic.tablexia.game.games.robbery.loader.RobberyTextureManager; public class FHead2Attribute extends HeadAttribute { @@ -32,7 +32,7 @@ public class FHead2Attribute extends HeadAttribute { private static final long serialVersionUID = 127719064850661L; { - add(new AttributeDescription(null, AttributeGender.FEMALE, RobberyTextureManager.ATTRIBUTE_F_HEAD_2, FHead2Attribute.class)); + add(new AttributeDescription(null, AttributeGender.FEMALE, RobberyAssets.ATTRIBUTE_F_HEAD_2, FHead2Attribute.class)); } }; diff --git a/core/src/cz/nic/tablexia/game/games/robbery/creature/attribute/head/MHead1Attribute.java b/core/src/cz/nic/tablexia/game/games/robbery/creature/attribute/head/MHead1Attribute.java index 35df04dfd88ac077eb61c23ce2e398fe3c0effbb..9d7bc1ea8feaf1b979b91cd82ceb9602377a4638 100644 --- a/core/src/cz/nic/tablexia/game/games/robbery/creature/attribute/head/MHead1Attribute.java +++ b/core/src/cz/nic/tablexia/game/games/robbery/creature/attribute/head/MHead1Attribute.java @@ -21,9 +21,9 @@ package cz.nic.tablexia.game.games.robbery.creature.attribute.head; import java.util.ArrayList; import java.util.List; +import cz.nic.tablexia.game.games.robbery.assets.RobberyAssets; import cz.nic.tablexia.game.games.robbery.creature.CreatureRoot.AttributeGender; import cz.nic.tablexia.game.games.robbery.creature.attribute.AttributeDescription; -import cz.nic.tablexia.game.games.robbery.loader.RobberyTextureManager; public class MHead1Attribute extends HeadAttribute { @@ -32,7 +32,7 @@ public class MHead1Attribute extends HeadAttribute { private static final long serialVersionUID = 5615637786804769905L; { - add(new AttributeDescription(null, AttributeGender.MALE, RobberyTextureManager.ATTRIBUTE_M_HEAD_1, MHead1Attribute.class)); + add(new AttributeDescription(null, AttributeGender.MALE, RobberyAssets.ATTRIBUTE_M_HEAD_1, MHead1Attribute.class)); } }; diff --git a/core/src/cz/nic/tablexia/game/games/robbery/creature/attribute/head/MHead2Attribute.java b/core/src/cz/nic/tablexia/game/games/robbery/creature/attribute/head/MHead2Attribute.java index d76171a58a63e01744d1fe29e9112474be7f643e..1a3de84f1278e1c766edab2f7e10a7609a96258e 100644 --- a/core/src/cz/nic/tablexia/game/games/robbery/creature/attribute/head/MHead2Attribute.java +++ b/core/src/cz/nic/tablexia/game/games/robbery/creature/attribute/head/MHead2Attribute.java @@ -21,9 +21,9 @@ package cz.nic.tablexia.game.games.robbery.creature.attribute.head; import java.util.ArrayList; import java.util.List; +import cz.nic.tablexia.game.games.robbery.assets.RobberyAssets; import cz.nic.tablexia.game.games.robbery.creature.CreatureRoot.AttributeGender; import cz.nic.tablexia.game.games.robbery.creature.attribute.AttributeDescription; -import cz.nic.tablexia.game.games.robbery.loader.RobberyTextureManager; public class MHead2Attribute extends HeadAttribute { @@ -32,7 +32,7 @@ public class MHead2Attribute extends HeadAttribute { private static final long serialVersionUID = 2081578052627163165L; { - add(new AttributeDescription(null, AttributeGender.MALE, RobberyTextureManager.ATTRIBUTE_M_HEAD_2, MHead2Attribute.class)); + add(new AttributeDescription(null, AttributeGender.MALE, RobberyAssets.ATTRIBUTE_M_HEAD_2, MHead2Attribute.class)); } }; diff --git a/core/src/cz/nic/tablexia/game/games/robbery/loader/RobberyDataManager.java b/core/src/cz/nic/tablexia/game/games/robbery/loader/RobberyDataManager.java deleted file mode 100644 index fde6282ad72b86485fd2b6063a8c6abd2761f806..0000000000000000000000000000000000000000 --- a/core/src/cz/nic/tablexia/game/games/robbery/loader/RobberyDataManager.java +++ /dev/null @@ -1,55 +0,0 @@ -package cz.nic.tablexia.game.games.robbery.loader; - -import com.badlogic.gdx.utils.async.AsyncTask; - -import cz.nic.tablexia.game.common.RandomAccess; -import cz.nic.tablexia.game.difficulty.GameDifficulty; -import cz.nic.tablexia.game.games.robbery.rules.GameRule; -import cz.nic.tablexia.game.games.robbery.rules.GameRulesDefinition; -import cz.nic.tablexia.game.loader.AbstractDataManager; -import cz.nic.tablexia.loader.IApplicationLoader; - -public class RobberyDataManager extends AbstractDataManager<GameRule> implements IApplicationLoader { - - private static int CREATURES_COUNT = 50; - private static int THIEVES_COUNT = 8; - - private static class RoberryRuleLoader implements AsyncTask<GameRule> { - - private RandomAccess randomAccess; - private GameDifficulty gameDifficulty; - - public RoberryRuleLoader(GameDifficulty gameDifficulty, RandomAccess randomAccess) { - this.gameDifficulty = gameDifficulty; - this.randomAccess = randomAccess; - } - - @Override - public GameRule call() throws Exception { - GameRulesDefinition rule = GameRulesDefinition.getRandomGameRuleForDifficulty(gameDifficulty, randomAccess.getRandom()); - GameRule gameRule = rule.getGameRuleInstance(randomAccess, CREATURES_COUNT, THIEVES_COUNT); - gameRule.generateCreatures(); - return gameRule; - } - } - - private static RobberyDataManager instance; - - private RobberyDataManager() {} - - public static RobberyDataManager getInstance() { - if (instance == null) { - instance = new RobberyDataManager(); - } - return instance; - } - - public void load(GameDifficulty gameDifficulty, RandomAccess randomAccess) { - setAsyncTask(new RoberryRuleLoader(gameDifficulty, randomAccess)); - } - - public void dispose() { - instance = null; - } - -} \ No newline at end of file diff --git a/core/src/cz/nic/tablexia/game/games/robbery/loader/RobberyTextManager.java b/core/src/cz/nic/tablexia/game/games/robbery/loader/RobberyTextManager.java deleted file mode 100644 index c006c3f8407cbb98bc5e11c527eb94d368ad0c0c..0000000000000000000000000000000000000000 --- a/core/src/cz/nic/tablexia/game/games/robbery/loader/RobberyTextManager.java +++ /dev/null @@ -1,53 +0,0 @@ -package cz.nic.tablexia.game.games.robbery.loader; - -import java.util.Locale; - -import com.badlogic.gdx.Gdx; -import com.badlogic.gdx.files.FileHandle; -import com.badlogic.gdx.utils.I18NBundle; -import com.badlogic.gdx.utils.async.AsyncTask; - -import cz.nic.tablexia.game.loader.AbstractDataManager; -import cz.nic.tablexia.loader.IApplicationLoader; - -public class RobberyTextManager extends AbstractDataManager<I18NBundle> implements IApplicationLoader { - - private static final String ROBBERY_TEXT = "game/robbery/text/robbery"; - - private static class RobberyTextLoader implements AsyncTask<I18NBundle> { - - private String textResourceFileName; - private Locale locale; - - public RobberyTextLoader(String textResourceFileName, Locale locale) { - this.textResourceFileName = textResourceFileName; - this.locale = locale; - } - - @Override - public I18NBundle call() throws Exception { - FileHandle baseFileHandle = Gdx.files.internal(textResourceFileName); - return I18NBundle.createBundle(baseFileHandle, locale); - } - } - - private static RobberyTextManager instance; - - private RobberyTextManager() {} - - public static RobberyTextManager getInstance() { - if (instance == null) { - instance = new RobberyTextManager(); - } - return instance; - } - - public void load(Locale locale) { - setAsyncTask(new RobberyTextLoader(ROBBERY_TEXT, locale)); - } - - public void dispose() { - instance = null; - } - -} \ No newline at end of file diff --git a/core/src/cz/nic/tablexia/game/games/robbery/rules/GameRule.java b/core/src/cz/nic/tablexia/game/games/robbery/rules/GameRule.java index 23a4099490a6200aadcd159d0e64ebf8d73ee2a9..cedf4a6b69c8d429503f6f559a900ea41f2b9cae 100644 --- a/core/src/cz/nic/tablexia/game/games/robbery/rules/GameRule.java +++ b/core/src/cz/nic/tablexia/game/games/robbery/rules/GameRule.java @@ -23,15 +23,15 @@ import java.util.List; import java.util.Map; import cz.nic.tablexia.game.common.RandomAccess; +import cz.nic.tablexia.game.games.robbery.RobberyScreen; import cz.nic.tablexia.game.games.robbery.creature.CreatureDescriptor; import cz.nic.tablexia.game.games.robbery.creature.CreatureFactory; import cz.nic.tablexia.game.games.robbery.creature.CreatureRoot; import cz.nic.tablexia.game.games.robbery.creature.attribute.Attribute; -import cz.nic.tablexia.game.games.robbery.creature.attribute.AttributeDescription; import cz.nic.tablexia.game.games.robbery.creature.attribute.Attribute.AttributeColor; +import cz.nic.tablexia.game.games.robbery.creature.attribute.AttributeDescription; import cz.nic.tablexia.game.games.robbery.creature.attribute.hair.HairAttribute; import cz.nic.tablexia.game.games.robbery.creature.attribute.head.HeadAttribute; -import cz.nic.tablexia.game.games.robbery.loader.RobberyTextManager; import cz.nic.tablexia.util.Log; /** @@ -258,11 +258,11 @@ public abstract class GameRule { */ protected String getAttributeColorName(AttributeDescription attributeDescription) { AttributeColor attributeColor = attributeDescription.getAttributeColor(); - return attributeColor != null ? RobberyTextManager.getInstance().getResult().get(attributeColor.getDescriptionResourceName()) : ""; + return attributeColor != null ? RobberyScreen.getRobberyText(attributeColor.getDescriptionResourceName()) : ""; } public String getRuleMessageText() { - return RobberyTextManager.getInstance().getResult().format(getGameRuleDefinition().getGameRuleStringName(), (Object[])getRuleMessageParameters()); + return RobberyScreen.getRobberyFormatedText(getGameRuleDefinition().getGameRuleStringName(), (Object[])getRuleMessageParameters()); } /** diff --git a/core/src/cz/nic/tablexia/loader/ApplicationTextManager.java b/core/src/cz/nic/tablexia/loader/ApplicationTextManager.java index 463f3b719054031bfbab14a5eacef385a1696644..e13b6f46513199c1e85280ebecd5e257568c62a2 100644 --- a/core/src/cz/nic/tablexia/loader/ApplicationTextManager.java +++ b/core/src/cz/nic/tablexia/loader/ApplicationTextManager.java @@ -52,7 +52,9 @@ public class ApplicationTextManager extends AbstractDataManager<I18NBundle> impl setAsyncTask(new RobberyTextLoader(ROBBERY_TEXT, locale)); } + @Override public void dispose() { + super.dispose(); instance = null; } diff --git a/core/src/cz/nic/tablexia/screen/AbstractTablexiaScreen.java b/core/src/cz/nic/tablexia/screen/AbstractTablexiaScreen.java index 60a00a892c395eb1fcefaa52c82f5c634a1d9941..1db60fb101837f2f8dbb083dcbd1f91e25475b55 100644 --- a/core/src/cz/nic/tablexia/screen/AbstractTablexiaScreen.java +++ b/core/src/cz/nic/tablexia/screen/AbstractTablexiaScreen.java @@ -7,6 +7,7 @@ import java.util.List; import java.util.Locale; import com.badlogic.gdx.Gdx; +import com.badlogic.gdx.InputProcessor; import com.badlogic.gdx.ScreenAdapter; import com.badlogic.gdx.assets.AssetManager; import com.badlogic.gdx.files.FileHandle; @@ -125,6 +126,13 @@ public abstract class AbstractTablexiaScreen<T> extends ScreenAdapter { } +//////////////////////////// INPUT PROCESSORS + + public InputProcessor getInputProcessor() { + return getStage(); + } + + //////////////////////////// LIBGDX LIFECYCLE @Override @@ -139,7 +147,6 @@ public abstract class AbstractTablexiaScreen<T> extends ScreenAdapter { @Override public final void resize(int width, int height) { - super.resize(width, height); stage.getViewport().update(width, height, true); if (loadingComplete) { performScreenResized(width, height); @@ -147,7 +154,7 @@ public abstract class AbstractTablexiaScreen<T> extends ScreenAdapter { } @Override - public void render(float delta) { + public final void render(float delta) { if (!loadingComplete) { if (loadingStarted) { if (!textureManager.update()) return; @@ -159,6 +166,7 @@ public abstract class AbstractTablexiaScreen<T> extends ScreenAdapter { notifyLoadingCompleteListeners(); } } else { + screenRender(delta); stage.act(Gdx.graphics.getDeltaTime()); stage.draw(); } @@ -196,10 +204,11 @@ public abstract class AbstractTablexiaScreen<T> extends ScreenAdapter { screenDisposed(); } + protected void screenRender(float delta) {}; protected void screenLoaded() {}; protected void screenVisible() {}; - protected void screenResized(int width, int height) {}; protected void screenDisposed() {}; + protected void screenResized(int width, int height) {}; protected void prepareScreenTextureAssetNames(List<String> texturesFileNames) {} protected String prepareScreenTextResourcesAssetName() { @@ -237,7 +246,11 @@ public abstract class AbstractTablexiaScreen<T> extends ScreenAdapter { return textManager.getResult().get(key); } - protected T getGameData() { + public String getFormatedText(String key, Object... args) { + return textManager.getResult().format(key, args); + } + + protected T getData() { return dataManager.getResult(); } diff --git a/core/src/cz/nic/tablexia/screen/statistics/StatisticsScreen.java b/core/src/cz/nic/tablexia/screen/statistics/StatisticsScreen.java index e390f14b270e1fe06342dde187e051e616d178bf..3a564b020acd2ba501c10e0708a9c4a57542b33e 100644 --- a/core/src/cz/nic/tablexia/screen/statistics/StatisticsScreen.java +++ b/core/src/cz/nic/tablexia/screen/statistics/StatisticsScreen.java @@ -40,7 +40,7 @@ public class StatisticsScreen extends AbstractTablexiaScreen<Void> { } @Override - protected void screenResized(int width, int height) { + public void screenResized(int width, int height) { backgroundLayout.setBounds(0, 0, getStage().getWidth(), getStage().getHeight()); }