use of eidolons.game.battlecraft.logic.dungeon.location.building.MapZone in project Eidolons by IDemiurge.
the class LocationBuilder method initZones.
private void initZones(Node zonesNode, DungeonPlan plan) {
int id = 0;
int zoneId = 0;
List<MapZone> zones = new ArrayList<>();
for (Node zoneNode : XML_Converter.getNodeList(zonesNode)) {
MapZone zone;
try {
zone = createZone(plan, zoneId, zoneNode);
} catch (Exception e) {
// main.system.ExceptionMaster.printStackTrace(e);
zone = new MapZone(plan.getDungeon(), zoneId, 0, plan.getDungeon().getWidth(), 0, plan.getDungeon().getHeight());
}
// ++ add coord exceptions
zoneId++;
zones.add(zone);
for (Node node : XML_Converter.getNodeList(XML_Converter.getNodeList(zoneNode).get(0))) {
// if (node.getNodeName().equalsIgnoreCase(BLOCKS_NODE))
// blocks = initBlocks(XML_Converter.getStringFromXML(node));
MapBlock block = constructBlock(node, id, zone, plan, getDungeon().getDungeon());
id++;
zone.addBlock(block);
plan.getBlocks().add(block);
}
}
if (plan.getBlocks().size() == 1) {
int w = plan.getBlocks().get(0).getWidth();
int h = plan.getBlocks().get(0).getHeight();
dungeon.setParam(PARAMS.BF_WIDTH, w, true);
dungeon.setParam(PARAMS.BF_HEIGHT, h, true);
}
plan.setZones(zones);
}
Aggregations