use of main.system.data.DataUnitFactory in project Eidolons by IDemiurge.
the class Dungeon method getPoint.
public Coordinates getPoint(String arg) {
Coordinates c = null;
if (arg.contains(ScriptSyntax.SPAWN_POINT) || StringMaster.isInteger(arg)) {
arg = arg.replace(ScriptSyntax.SPAWN_POINT, "");
Integer i = StringMaster.getInteger(arg) - 1;
List<String> spawnPoints = StringMaster.openContainer(getProperty(PROPS.COORDINATE_POINTS));
c = new Coordinates(spawnPoints.get(i));
} else {
Map<String, String> map = new DataUnitFactory(true).deconstructDataString(getProperty(PROPS.NAMED_COORDINATE_POINTS));
String string = map.get(arg);
if (string == null) {
// find
Object key = new SearchMaster<>().findClosest(arg, map.keySet());
string = map.get(key);
}
return new Coordinates(string);
}
return c;
// getProperty(PROPS.ENCOUNTER_SPAWN_POINTS)
}
use of main.system.data.DataUnitFactory 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
}
Aggregations