Commit edcefead authored by Aneta Steimarova's avatar Aneta Steimarova

#965 Removed hasBonus vasiable. Locked bonus until the rule is not done.

parent c947fde6
Pipeline #42721 failed with stages
in 11 minutes and 29 seconds
......@@ -45,23 +45,22 @@ import cz.nic.tablexia.shared.model.resolvers.AbstractGameScoreResolver;
public enum GameDefinition implements ApplicationEvent, IMenuItem, INumberedDefinition {
ROBBERY (cz.nic.tablexia.shared.model.definitions.GameDefinition.ROBBERY, ApplicationTextManager.ApplicationTextsAssets.GAME_ROBBERY_TITLE, ApplicationTextManager.ApplicationTextsAssets.GAME_ROBBERY_DESCRIPTION, RobberyGame.class, false, true, ApplicationTextManager.ApplicationTextsAssets.GAME_SCORE, ApplicationTextManager.ApplicationTextsAssets.GAME_AVERAGE_SCORE),
PURSUIT (cz.nic.tablexia.shared.model.definitions.GameDefinition.PURSUIT, ApplicationTextManager.ApplicationTextsAssets.GAME_PURSUIT_TITLE, ApplicationTextManager.ApplicationTextsAssets.GAME_PURSUIT_DESCRIPTION, PursuitGame.class, false, true, ApplicationTextManager.ApplicationTextsAssets.GAME_SCORE_DURATION, ApplicationTextManager.ApplicationTextsAssets.GAME_AVERAGE_SCORE_DURATION),
KIDNAPPING (cz.nic.tablexia.shared.model.definitions.GameDefinition.KIDNAPPING, ApplicationTextManager.ApplicationTextsAssets.GAME_KIDNAPPING_TITLE, ApplicationTextManager.ApplicationTextsAssets.GAME_KIDNAPPING_DESCRIPTION, KidnappingGame.class, false, true, ApplicationTextManager.ApplicationTextsAssets.GAME_SCORE_ERROR, ApplicationTextManager.ApplicationTextsAssets.GAME_AVERAGE_SCORE_ERROR),
NIGHT_WATCH (cz.nic.tablexia.shared.model.definitions.GameDefinition.NIGHT_WATCH, ApplicationTextManager.ApplicationTextsAssets.GAME_NIGHT_WATCH_TITLE, ApplicationTextManager.ApplicationTextsAssets.GAME_NIGHT_WATCH_DESCRIPTION, NightWatchGame.class, false, true, ApplicationTextManager.ApplicationTextsAssets.GAME_SCORE, ApplicationTextManager.ApplicationTextsAssets.GAME_AVERAGE_SCORE),
SHOOTING_RANGE (cz.nic.tablexia.shared.model.definitions.GameDefinition.SHOOTING_RANGE, ApplicationTextManager.ApplicationTextsAssets.GAME_SHOOTING_RANGE_TITLE, ApplicationTextManager.ApplicationTextsAssets.GAME_SHOOTING_RANGE_DESCRIPTION, ShootingRangeGame.class, false, true, ApplicationTextManager.ApplicationTextsAssets.GAME_SCORE, ApplicationTextManager.ApplicationTextsAssets.GAME_AVERAGE_SCORE),
IN_THE_DARKNESS (cz.nic.tablexia.shared.model.definitions.GameDefinition.IN_THE_DARKNESS, ApplicationTextManager.ApplicationTextsAssets.GAME_IN_THE_DARKNESS_TITLE, ApplicationTextManager.ApplicationTextsAssets.GAME_IN_THE_DARKNESS_DESCRIPTION, InTheDarknessGame.class, true, true, ApplicationTextManager.ApplicationTextsAssets.GAME_SCORE_ERROR, ApplicationTextManager.ApplicationTextsAssets.GAME_AVERAGE_SCORE_ERROR),
RUNES (cz.nic.tablexia.shared.model.definitions.GameDefinition.RUNES, ApplicationTextManager.ApplicationTextsAssets.GAME_RUNES_TITLE, ApplicationTextManager.ApplicationTextsAssets.GAME_RUNES_DESCRIPTION, RunesGame.class, false, true, ApplicationTextManager.ApplicationTextsAssets.GAME_SCORE, ApplicationTextManager.ApplicationTextsAssets.GAME_AVERAGE_SCORE),
CRIME_SCENE (cz.nic.tablexia.shared.model.definitions.GameDefinition.CRIME_SCENE, ApplicationTextManager.ApplicationTextsAssets.GAME_CRIME_SCENE_TITLE, ApplicationTextManager.ApplicationTextsAssets.GAME_CRIME_SCENE_DESCRIPTION, CrimeSceneGame.class, false, true, ApplicationTextManager.ApplicationTextsAssets.GAME_SCORE, ApplicationTextManager.ApplicationTextsAssets.GAME_AVERAGE_SCORE),
PROTOCOL (cz.nic.tablexia.shared.model.definitions.GameDefinition.PROTOCOL,ApplicationTextManager.ApplicationTextsAssets.GAME_PROTOCOL_TITLE,ApplicationTextManager.ApplicationTextsAssets.GAME_PROTOCOL_DESCRIPTION, ProtocolGame.class, false, true, ApplicationTextManager.ApplicationTextsAssets.GAME_SCORE,ApplicationTextManager.ApplicationTextsAssets.GAME_AVERAGE_SCORE),
SAFE (cz.nic.tablexia.shared.model.definitions.GameDefinition.SAFE, ApplicationTextManager.ApplicationTextsAssets.GAME_SAFE_TITLE, ApplicationTextManager.ApplicationTextsAssets.GAME_SAFE_DESCRIPTION, SafeGame.class, false, true, ApplicationTextManager.ApplicationTextsAssets.GAME_SCORE, ApplicationTextManager.ApplicationTextsAssets.GAME_AVERAGE_SCORE);
ROBBERY (cz.nic.tablexia.shared.model.definitions.GameDefinition.ROBBERY, ApplicationTextManager.ApplicationTextsAssets.GAME_ROBBERY_TITLE, ApplicationTextManager.ApplicationTextsAssets.GAME_ROBBERY_DESCRIPTION, RobberyGame.class, false, ApplicationTextManager.ApplicationTextsAssets.GAME_SCORE, ApplicationTextManager.ApplicationTextsAssets.GAME_AVERAGE_SCORE),
PURSUIT (cz.nic.tablexia.shared.model.definitions.GameDefinition.PURSUIT, ApplicationTextManager.ApplicationTextsAssets.GAME_PURSUIT_TITLE, ApplicationTextManager.ApplicationTextsAssets.GAME_PURSUIT_DESCRIPTION, PursuitGame.class, false, ApplicationTextManager.ApplicationTextsAssets.GAME_SCORE_DURATION, ApplicationTextManager.ApplicationTextsAssets.GAME_AVERAGE_SCORE_DURATION),
KIDNAPPING (cz.nic.tablexia.shared.model.definitions.GameDefinition.KIDNAPPING, ApplicationTextManager.ApplicationTextsAssets.GAME_KIDNAPPING_TITLE, ApplicationTextManager.ApplicationTextsAssets.GAME_KIDNAPPING_DESCRIPTION, KidnappingGame.class, false, ApplicationTextManager.ApplicationTextsAssets.GAME_SCORE_ERROR, ApplicationTextManager.ApplicationTextsAssets.GAME_AVERAGE_SCORE_ERROR),
NIGHT_WATCH (cz.nic.tablexia.shared.model.definitions.GameDefinition.NIGHT_WATCH, ApplicationTextManager.ApplicationTextsAssets.GAME_NIGHT_WATCH_TITLE, ApplicationTextManager.ApplicationTextsAssets.GAME_NIGHT_WATCH_DESCRIPTION, NightWatchGame.class, false, ApplicationTextManager.ApplicationTextsAssets.GAME_SCORE, ApplicationTextManager.ApplicationTextsAssets.GAME_AVERAGE_SCORE),
SHOOTING_RANGE (cz.nic.tablexia.shared.model.definitions.GameDefinition.SHOOTING_RANGE, ApplicationTextManager.ApplicationTextsAssets.GAME_SHOOTING_RANGE_TITLE, ApplicationTextManager.ApplicationTextsAssets.GAME_SHOOTING_RANGE_DESCRIPTION, ShootingRangeGame.class, false, ApplicationTextManager.ApplicationTextsAssets.GAME_SCORE, ApplicationTextManager.ApplicationTextsAssets.GAME_AVERAGE_SCORE),
IN_THE_DARKNESS (cz.nic.tablexia.shared.model.definitions.GameDefinition.IN_THE_DARKNESS, ApplicationTextManager.ApplicationTextsAssets.GAME_IN_THE_DARKNESS_TITLE, ApplicationTextManager.ApplicationTextsAssets.GAME_IN_THE_DARKNESS_DESCRIPTION, InTheDarknessGame.class, true, ApplicationTextManager.ApplicationTextsAssets.GAME_SCORE_ERROR, ApplicationTextManager.ApplicationTextsAssets.GAME_AVERAGE_SCORE_ERROR),
RUNES (cz.nic.tablexia.shared.model.definitions.GameDefinition.RUNES, ApplicationTextManager.ApplicationTextsAssets.GAME_RUNES_TITLE, ApplicationTextManager.ApplicationTextsAssets.GAME_RUNES_DESCRIPTION, RunesGame.class, false, ApplicationTextManager.ApplicationTextsAssets.GAME_SCORE, ApplicationTextManager.ApplicationTextsAssets.GAME_AVERAGE_SCORE),
CRIME_SCENE (cz.nic.tablexia.shared.model.definitions.GameDefinition.CRIME_SCENE, ApplicationTextManager.ApplicationTextsAssets.GAME_CRIME_SCENE_TITLE, ApplicationTextManager.ApplicationTextsAssets.GAME_CRIME_SCENE_DESCRIPTION, CrimeSceneGame.class, false, ApplicationTextManager.ApplicationTextsAssets.GAME_SCORE, ApplicationTextManager.ApplicationTextsAssets.GAME_AVERAGE_SCORE),
PROTOCOL (cz.nic.tablexia.shared.model.definitions.GameDefinition.PROTOCOL,ApplicationTextManager.ApplicationTextsAssets.GAME_PROTOCOL_TITLE,ApplicationTextManager.ApplicationTextsAssets.GAME_PROTOCOL_DESCRIPTION, ProtocolGame.class, false, ApplicationTextManager.ApplicationTextsAssets.GAME_SCORE,ApplicationTextManager.ApplicationTextsAssets.GAME_AVERAGE_SCORE),
SAFE (cz.nic.tablexia.shared.model.definitions.GameDefinition.SAFE, ApplicationTextManager.ApplicationTextsAssets.GAME_SAFE_TITLE, ApplicationTextManager.ApplicationTextsAssets.GAME_SAFE_DESCRIPTION, SafeGame.class, false, ApplicationTextManager.ApplicationTextsAssets.GAME_SCORE, ApplicationTextManager.ApplicationTextsAssets.GAME_AVERAGE_SCORE);
private final cz.nic.tablexia.shared.model.definitions.GameDefinition modelGameDefinition;
private String menuTextKey;
private String descriptionResource;
private Class<? extends AbstractTablexiaGame<?>> screenClass;
private boolean hasTutorial;
private boolean hasBonus;
private String statisticsScoreDialogText;
private String statisticsAverageScoreDialogText;
......@@ -75,7 +74,6 @@ public enum GameDefinition implements ApplicationEvent, IMenuItem, INumberedDefi
this.descriptionResource = descriptionResource;
this.screenClass = screenClass;
this.hasTutorial = hasTutorial;
this.hasBonus = hasBonus;
this.statisticsScoreDialogText = statisticsDialogText;
this.statisticsAverageScoreDialogText = statisticsAverageScoreDialogText;
}
......@@ -112,10 +110,6 @@ public enum GameDefinition implements ApplicationEvent, IMenuItem, INumberedDefi
return hasTutorial;
}
public boolean isHasBonus() {
return hasBonus;
}
@Override
public void performAction() {
ApplicationBus.getInstance().publishAsync(this);
......
......@@ -386,11 +386,7 @@ public class GamePageGroup extends Group {
}
private boolean isBonusDifficultyUnlocked() {
if (!TablexiaSettings.getInstance().getBuildType().equals(TablexiaSettings.BuildType.RELEASE)) {
return gameDefinition.isHasBonus();
} else {
return gameDefinition.isHasBonus() && GameDAO.isBonusDifficultyUnlocked(gameDefinition.getGameNumber(), TablexiaSettings.getInstance().getSelectedUser().getId());
}
return GameDAO.isBonusDifficultyUnlocked(gameDefinition.getGameNumber(), TablexiaSettings.getInstance().getSelectedUser().getId());
}
private void showBonusDifficultyLockedDialog() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment