use of eidolons.game.battlecraft.logic.dungeon.location.building.MapBlock 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);
}
use of eidolons.game.battlecraft.logic.dungeon.location.building.MapBlock in project Eidolons by IDemiurge.
the class TestSpawner method initGroup.
private void initGroup(Wave group) {
GroupAI groupAi = new GroupAI(group);
groupAi.setLeader(group.getParty().getLeader());
groupAi.setWanderDirection(FacingMaster.getRandomFacing().getDirection());
group.setAi(groupAi);
if (getGame().getGameMode() == GAME_MODES.DUNGEON_CRAWL) {
XList<MapBlock> permittedBlocks = new XList<>();
permittedBlocks.addAllUnique(group.getBlock().getConnectedBlocks().keySet());
int wanderBlockDistance = 1;
for (int i = 0; i < wanderBlockDistance; i++) {
for (MapBlock b : group.getBlock().getConnectedBlocks().keySet()) {
permittedBlocks.addAllUnique(b.getConnectedBlocks().keySet());
}
}
groupAi.setPermittedBlocks(permittedBlocks);
}
}
Aggregations