use of main.entity.type.ObjType in project Eidolons by IDemiurge.
the class HT_MapBuilder method addAltBaseLinks.
private void addAltBaseLinks(Point point, HT_Node node) {
ObjType type = node.getType();
String prop = type.getProperty(PROPS.ALT_BASE_LINKS);
if (prop.isEmpty()) {
return;
}
StaticTreeLink link = getStaticLink(type);
for (String s : StringMaster.open(prop)) {
addAltBaseLink(link, s, type, point);
}
}
use of main.entity.type.ObjType in project Eidolons by IDemiurge.
the class HT_MapBuilder method getTypesWithinRange.
public List<ObjType> getTypesWithinRange(ObjType type, int i, int sublingCount, int xMaxRange, int yMaxRange) {
ObjType parent = DataManager.getParent(type);
int y1 = getY(type, parent);
Point pointForType = // TODO
parent == null ? // TODO
new PointX(getX(0, i, sublingCount, type, parent), y1) : // ???
map.getPointForType(parent);
int x1 = getX(pointForType.x, i, sublingCount, type, parent);
return map.getTypesWithinRange(type, i, sublingCount, x1, y1, xMaxRange, yMaxRange);
}
use of main.entity.type.ObjType in project Eidolons by IDemiurge.
the class HT_MapBuilder method initGroups.
protected void initGroups(List<ObjType> data) {
for (ObjType c : data) {
// init groups
String group = c.getProperty(PROPS.TREE_NODE_GROUP);
if (group.isEmpty()) {
continue;
}
List<ObjType> types = groupsMap.get(group);
if (types == null) {
types = new ArrayList<>();
groupsMap.put(group, types);
}
types.add(c);
}
// List<ObjType> workList = new ArrayList<>(children);
for (String group : groupsMap.keySet()) {
initGroupNodePos(groupsMap.get(group));
// sort within each group
// go through groups and take first element, add by lowest id
// int id = c.getIntParam(params.id);
// prevIndex = children.indexOf(o);
// children.set(index, element);
}
// append groups
}
use of main.entity.type.ObjType in project Eidolons by IDemiurge.
the class TreeMap method getTypesWithinRange.
public List<ObjType> getTypesWithinRange(ObjType type, int i, int sublingCount, int x1, int y1, int xRange, int yRange, Boolean left_right_both, Boolean up_down_both, Boolean and_or_xor) {
List<ObjType> typesOnRow = new ArrayList<>();
ObjType parent = DataManager.getParent(type);
for (Point p : getNodeMap().keySet()) {
ObjType t = getNodeMap().get(p).getType();
if (t == parent) {
continue;
}
// Point point = map.getPointForType(parent);
// ?
int x = getPointForType(t).x;
int xDiff = Math.abs(x1 - x);
boolean xOverlap = xDiff < xRange;
if (xOverlap) {
if (BooleanMaster.isFalse(and_or_xor)) {
typesOnRow.add(t);
continue;
} else {
int y = getPointForType(t).y;
int yDiff = Math.abs(y1 - y);
// if (up_down_both != null) {
// if (up_down_both)
// yDiff = y1 - y;
// else
// yDiff = y - y1; // ??
// }
boolean yOverlap = yDiff < yRange;
if (yOverlap) {
if (BooleanMaster.isFalse(and_or_xor)) {
typesOnRow.add(t);
continue;
}
}
if (BooleanMaster.isTrue(and_or_xor)) {
if (yOverlap && xOverlap) {
typesOnRow.add(t);
}
}
}
}
// alternatively, use SD to make different versions of links...
// shorter/longer
}
return typesOnRow;
}
use of main.entity.type.ObjType in project Eidolons by IDemiurge.
the class HC_Controls method testNameGen.
private void testNameGen() {
String content = FileManager.readFile(PathFinder.getXML_PATH() + "names\\" + "names.xml");
while (true) {
ObjType type = ListChooser.chooseTypeObj_(DC_TYPE.CHARS, "Background");
if (type == null) {
break;
}
String name;
while (true) {
name = CharacterCreator.getHeroName(type);
if (name == null) {
break;
}
if (name.equals(NameMaster.NO_NAME)) {
break;
}
content += name + ";";
}
}
if (!content.isEmpty()) {
XML_Writer.write(content, PathFinder.getXML_PATH() + "names\\", "names.xml");
}
}
Aggregations