Skip to content
Snippets Groups Projects
Commit 23f212e3 authored by Frantisek Simon's avatar Frantisek Simon
Browse files

Changed space indent to tabs

parent 3d8d8987
No related branches found
No related tags found
No related merge requests found
......@@ -104,13 +104,13 @@ public class RobberyGame extends AbstractTablexiaGame<GameRule> {
public static int CREATURES_COUNT = 50;
public static int THIEVES_COUNT = 8;
public static int CREATURES_WIDTH = 193;
public static int CREATURES_HEIGHT = 480;
public static int CREATURES_WIDTH = 193;
public static int CREATURES_HEIGHT = 480;
private InputMultiplexer inputMultiplexer;
private AbstractTablexiaScreen<Void> actualScreen;
private GameRulesDefinition rulesDefinition;
private GameRulesDefinition forcedRulesDefinition;
private GameRulesDefinition forcedRulesDefinition;
private boolean isRootScreenVisible;
......@@ -122,83 +122,83 @@ public class RobberyGame extends AbstractTablexiaGame<GameRule> {
//////////////////////////// SCREEN LOADERS
@Override
protected void prepareGameSoundAssetNames(List<String> soundsFileNames) {
soundsFileNames.add(RobberyAssets.SOUND_ALARM);
soundsFileNames.add(RobberyAssets.SOUND_ERROR);
soundsFileNames.add(RobberyAssets.SOUND_CHAINS);
soundsFileNames.add(RobberyAssets.SOUND_STEPS_FEMALE_1_IN);
soundsFileNames.add(RobberyAssets.SOUND_STEPS_FEMALE_1_OUT);
soundsFileNames.add(RobberyAssets.SOUND_STEPS_FEMALE_2_IN);
soundsFileNames.add(RobberyAssets.SOUND_STEPS_FEMALE_2_OUT);
soundsFileNames.add(RobberyAssets.SOUND_STEPS_MALE_1_IN);
soundsFileNames.add(RobberyAssets.SOUND_STEPS_MALE_1_OUT);
soundsFileNames.add(RobberyAssets.SOUND_STEPS_MALE_2_IN);
soundsFileNames.add(RobberyAssets.SOUND_STEPS_MALE_2_OUT);
soundsFileNames.add(RobberyAssets.SOUND_STEPS_MALE_3_IN);
soundsFileNames.add(RobberyAssets.SOUND_STEPS_MALE_3_OUT);
soundsFileNames.add(RobberyAssets.SOUND_STEPS_FEMALE_1_IN);
soundsFileNames.add(RobberyAssets.SOUND_STEPS_FEMALE_1_OUT);
soundsFileNames.add(RobberyAssets.SOUND_STEPS_FEMALE_2_IN);
soundsFileNames.add(RobberyAssets.SOUND_STEPS_FEMALE_2_OUT);
soundsFileNames.add(RobberyAssets.SOUND_STEPS_MALE_1_IN);
soundsFileNames.add(RobberyAssets.SOUND_STEPS_MALE_1_OUT);
soundsFileNames.add(RobberyAssets.SOUND_STEPS_MALE_2_IN);
soundsFileNames.add(RobberyAssets.SOUND_STEPS_MALE_2_OUT);
soundsFileNames.add(RobberyAssets.SOUND_STEPS_MALE_3_IN);
soundsFileNames.add(RobberyAssets.SOUND_STEPS_MALE_3_OUT);
}
@Override
protected GameRule prepareGameData(Map<String, String> gameState) {
rulesDefinition = forcedRulesDefinition != null ? forcedRulesDefinition : GameRulesDefinition.getRandomGameRuleForDifficulty(getGameDifficulty(), getRandom());
GameRule gameRule = rulesDefinition.getGameRuleInstance(getRandom(), CREATURES_COUNT, THIEVES_COUNT);
gameRule.generateCreatures(this);
rulesDefinition = forcedRulesDefinition != null ? forcedRulesDefinition : GameRulesDefinition.getRandomGameRuleForDifficulty(getGameDifficulty(), getRandom());
GameRule gameRule = rulesDefinition.getGameRuleInstance(getRandom(), CREATURES_COUNT, THIEVES_COUNT);
gameRule.generateCreatures(this);
actualCreatureNumber = getGameScoreInteger(SCORE_KEY_PERSON_NUMBER, 0);
thievesEscaped = getGameScoreInteger(SCORE_KEY_ESCAPED_THIEVES, 0);
innocencePersons = getGameScoreInteger(SCORE_KEY_INNOCENCE_PERSON, 0);
thievesCaught = getGameScoreInteger(SCORE_KEY_CAUGHT_THIEF, 0);
printScreenInfo("Game Rule", gameRule.getGameRuleDefinition().name());
printScreenInfo("Game Rule", gameRule.getGameRuleDefinition().name());
return gameRule;
}
//////////////////////////// INPUT PROCESSOR
@Override
public InputProcessor getInputProcessor() {
return inputMultiplexer;
}
//////////////////////////// SCREEN LIFECYCLE
public RobberyGame() {
isRootScreenVisible = false;
isComponentScreenVisible = false;
inputMultiplexer = new InputMultiplexer();
inputMultiplexer.addProcessor(getStage());
inputMultiplexer.addProcessor(getStage());
}
@Override
protected void gameLoaded(Map<String, String> gameState) {
setGameScore(SCORE_KEY_PERSON_COUNT, RobberyGame.CREATURES_COUNT);
setGameScore(SCORE_KEY_THIEVES_COUNT, RobberyGame.THIEVES_COUNT);
if (actualCreatureNumber > 0) {
showGameScreen(false);
} else {
showRuleScreen(false);
}
if (actualCreatureNumber > 0) {
showGameScreen(false);
} else {
showRuleScreen(false);
}
}
@Override
protected void gameVisible() {
isRootScreenVisible = true;
performComponentScreenVisible();
}
@Override
public void screenResized(int width, int height) {
if (actualScreen != null) {
actualScreen.resize(width, height);
}
}
@Override
public void gameRender(float delta) {
if (actualScreen != null) {
......@@ -237,34 +237,34 @@ public class RobberyGame extends AbstractTablexiaGame<GameRule> {
private void showScreen(final AbstractTablexiaScreen newScreen, boolean transaction) {
isComponentScreenVisible = false;
if (transaction) {
performHideTransaction(new Runnable() {
@Override
public void run() {
processNewScreen(newScreen);
performShowTransaction(new Runnable() {
@Override
public void run() {
isComponentScreenVisible = true;
performComponentScreenVisible();
}
});
}
});
performHideTransaction(new Runnable() {
@Override
public void run() {
processNewScreen(newScreen);
performShowTransaction(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;
......@@ -272,7 +272,7 @@ public class RobberyGame extends AbstractTablexiaGame<GameRule> {
inputMultiplexer.addProcessor(newScreen.getInputProcessor());
newScreen.show();
if (lastScreen != null) {
if (lastScreen != null) {
processLastScreen(lastScreen);
}
}
......@@ -286,19 +286,19 @@ public class RobberyGame extends AbstractTablexiaGame<GameRule> {
public void showGameScreen(final boolean transaction) {
Gdx.app.postRunnable(new Runnable() {
@Override
public void run() {
showScreen(new GameScreen(RobberyGame.this), transaction);
}
});
@Override
public void run() {
showScreen(new GameScreen(RobberyGame.this), transaction);
}
});
}
private void showRuleScreen(final boolean transaction) {
Gdx.app.postRunnable(new Runnable() {
@Override
public void run() {
showScreen(new RuleScreen(RobberyGame.this), transaction);
showScreen(new RuleScreen(RobberyGame.this), transaction);
}
});
}
......@@ -306,12 +306,12 @@ public class RobberyGame extends AbstractTablexiaGame<GameRule> {
//////////////////////////// GAME SCORE
public int getActualCreatureNumber() {
return actualCreatureNumber;
}
public int getActualCreatureNumber() {
return actualCreatureNumber;
}
public void setActualCreatureNumber(int actualCreatureNumber) {
this.actualCreatureNumber = actualCreatureNumber;
public void setActualCreatureNumber(int actualCreatureNumber) {
this.actualCreatureNumber = actualCreatureNumber;
setGameScore(SCORE_KEY_PERSON_NUMBER, actualCreatureNumber);
}
......@@ -343,12 +343,12 @@ public class RobberyGame extends AbstractTablexiaGame<GameRule> {
}
public GameRulesDefinition getRulesDefinition() {
return rulesDefinition;
}
return rulesDefinition;
}
public void setForcedRulesDefinition(GameRulesDefinition forcedRulesDefinition) {
this.forcedRulesDefinition = forcedRulesDefinition;
}
public void setForcedRulesDefinition(GameRulesDefinition forcedRulesDefinition) {
this.forcedRulesDefinition = forcedRulesDefinition;
}
//////////////////////////////////////////// PRELOADER
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment