Search in sources :

Example 1 with GAMEPLAY_OPTION

use of eidolons.system.options.GameplayOptions.GAMEPLAY_OPTION in project Eidolons by IDemiurge.

the class OptionsMaster method applyGameplayOptions.

private static void applyGameplayOptions(GameplayOptions gameplayOptions) {
    for (Object sub : gameplayOptions.getValues().keySet()) {
        new EnumMaster<GAMEPLAY_OPTION>().retrieveEnumConst(GAMEPLAY_OPTION.class, gameplayOptions.getValues().get(sub).toString());
        GAMEPLAY_OPTION key = gameplayOptions.getKey((sub.toString()));
        String value = gameplayOptions.getValue(key);
        if (!StringMaster.isInteger(value)) {
            switch(key) {
                case RULES_SCOPE:
                    RuleMaster.setScope(new EnumMaster<RULE_SCOPE>().retrieveEnumConst(RULE_SCOPE.class, gameplayOptions.getValues().get(sub).toString()));
                    break;
                case GAME_DIFFICULTY:
                    if (Eidolons.game != null)
                        if (Eidolons.game.getBattleMaster() != null)
                            Eidolons.game.getBattleMaster().getOptionManager().difficultySet(value);
                    break;
            }
        }
    }
}
Also used : EnumMaster(main.system.auxiliary.EnumMaster) RULE_SCOPE(eidolons.game.battlecraft.rules.RuleMaster.RULE_SCOPE) GAMEPLAY_OPTION(eidolons.system.options.GameplayOptions.GAMEPLAY_OPTION)

Aggregations

RULE_SCOPE (eidolons.game.battlecraft.rules.RuleMaster.RULE_SCOPE)1 GAMEPLAY_OPTION (eidolons.system.options.GameplayOptions.GAMEPLAY_OPTION)1 EnumMaster (main.system.auxiliary.EnumMaster)1