Search in sources :

Example 1 with DungeonData

use of eidolons.game.battlecraft.logic.dungeon.universal.DungeonData in project Eidolons by IDemiurge.

the class Loader method initDungeon.

private static void initDungeon(Node dungeonNode) {
    String xml = XML_Converter.toString(dungeonNode);
    String name = XML_Converter.findNode(xml, "Name").getTextContent();
    String path = XML_Converter.findNode(xml, "LevelFilePath").getTextContent();
    DataUnitFactory factory = new DataUnitFactory(DungeonData.FORMAT);
    factory.setValueNames(DUNGEON_VALUE.TYPE_NAME, DUNGEON_VALUE.PATH);
    factory.setValues(name, path);
    DungeonData data = new DungeonData(factory.constructDataString());
    getGame().getDataKeeper().setDungeonData(data);
// ObjType type = DataManager.getType(XML_Converter.findNode(
// xml, "Name")
// .getTextContent(), DC_TYPE.DUNGEONS);
// Map<PROPERTY, String> props = getPropsFromNode(xml);
// Map<PARAMETER, String> params = getParamsFromNode(xml);
// getGame().getDungeonMaster().s
}
Also used : DataUnitFactory(main.system.data.DataUnitFactory) DungeonData(eidolons.game.battlecraft.logic.dungeon.universal.DungeonData)

Example 2 with DungeonData

use of eidolons.game.battlecraft.logic.dungeon.universal.DungeonData in project Eidolons by IDemiurge.

the class PresetLauncher method launchPreset.

public static void launchPreset(Preset profile) {
    PresetMaster.setPreset(profile);
    if (data == null)
        data = new DungeonData();
    for (PRESET_DATA item : PRESET_DATA.values()) {
        String value = profile.getValue(item);
        String valueName = "";
        if (value != null) {
            switch(item) {
                case CONTENT_SCOPE:
                    initContentScope(value);
                    break;
                case OPTIONS:
                    initOptions(value);
                    break;
                case PRESET_OPTION_PARAMS:
                    initOptionParams(value);
                    break;
                case ENEMY_PARTY:
                    // TODO   initDefaultParty(value, false);
                    break;
                case ENEMIES:
                case PLAYER_UNITS:
                    valueName = PARTY_VALUE.MEMBERS.toString();
                    break;
                case PLAYER_PARTY:
                    // valueName= PARTY_VALUE.PARTY_NAME;
                    break;
                case DUNGEONS:
                    initDungeonsList(value);
                    break;
                case FIRST_DUNGEON:
                    if (value.contains("."))
                        valueName = DUNGEON_VALUE.PATH.toString();
                    else
                        valueName = DUNGEON_VALUE.TYPE_NAME.toString();
                    break;
            }
        }
        data.setValue(valueName, value);
    }
/*
         * set dungeon, layer, encounter, party, options, ...
		 */
}
Also used : DungeonData(eidolons.game.battlecraft.logic.dungeon.universal.DungeonData) PRESET_DATA(eidolons.test.Preset.PRESET_DATA)

Aggregations

DungeonData (eidolons.game.battlecraft.logic.dungeon.universal.DungeonData)2 PRESET_DATA (eidolons.test.Preset.PRESET_DATA)1 DataUnitFactory (main.system.data.DataUnitFactory)1