use of main.content.enums.DungeonEnums.DUNGEON_MAP_TEMPLATE in project Eidolons by IDemiurge.
the class DungeonMapGenerator method fill.
private void fill(Coordinates c, String fillerType) {
ObjType type = DataManager.getType(fillerType, DC_TYPE.BF_OBJ);
if (type == null) {
MAP_FILL_TEMPLATE leTemplate = new EnumMaster<MAP_FILL_TEMPLATE>().retrieveEnumConst(MAP_FILL_TEMPLATE.class, fillerType);
if (leTemplate != null) {
int i = 0;
for (Coordinates adj : c.getAdjacentCoordinates()) {
ObjType objType = objMap.get(adj);
if (objType != null) {
if ((leTemplate.getPeripheryObjects() + leTemplate.getCenterObjects()).contains(objType.getName())) {
i++;
}
}
}
if (i >= c.getAdjacentCoordinates().size() * 2 / 5) {
type = RandomWizard.getObjTypeByWeight(leTemplate.getCenterObjects(), DC_TYPE.BF_OBJ);
objMap.put(c, type);
return;
}
type = RandomWizard.getObjTypeByWeight(leTemplate.getPeripheryObjects(), DC_TYPE.BF_OBJ);
} else {
// other random groups
DUNGEON_MAP_TEMPLATE template = new EnumMaster<DUNGEON_MAP_TEMPLATE>().retrieveEnumConst(DUNGEON_MAP_TEMPLATE.class, fillerType);
if (template != null) {
type = RandomWizard.getObjTypeByWeight(template.getObjects(), DC_TYPE.BF_OBJ);
}
}
}
objMap.put(c, type);
}
Aggregations