Search in sources :

Example 41 with ObjType

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);
    }
}
Also used : ObjType(main.entity.type.ObjType)

Example 42 with ObjType

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);
}
Also used : ObjType(main.entity.type.ObjType) PointX(main.swing.PointX)

Example 43 with ObjType

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
}
Also used : ObjType(main.entity.type.ObjType)

Example 44 with ObjType

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;
}
Also used : ObjType(main.entity.type.ObjType) ArrayList(java.util.ArrayList)

Example 45 with ObjType

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");
    }
}
Also used : ObjType(main.entity.type.ObjType)

Aggregations

ObjType (main.entity.type.ObjType)354 ArrayList (java.util.ArrayList)42 Coordinates (main.game.bf.Coordinates)30 Ref (main.entity.Ref)25 Unit (eidolons.entity.obj.unit.Unit)24 OBJ_TYPE (main.content.OBJ_TYPE)18 PROPERTY (main.content.values.properties.PROPERTY)18 DC_TYPE (main.content.DC_TYPE)16 PARAMETER (main.content.values.parameters.PARAMETER)16 File (java.io.File)15 Entity (main.entity.Entity)12 XLinkedMap (main.data.XLinkedMap)11 EnumMaster (main.system.auxiliary.EnumMaster)11 DC_SpellObj (eidolons.entity.active.DC_SpellObj)9 MATERIAL (main.content.enums.entity.ItemEnums.MATERIAL)9 Obj (main.entity.obj.Obj)9 QUALITY_LEVEL (main.content.enums.entity.ItemEnums.QUALITY_LEVEL)8 MusicList (main.music.entity.MusicList)8 Wave (eidolons.game.battlecraft.logic.battle.arena.Wave)6 C_OBJ_TYPE (main.content.C_OBJ_TYPE)6