Search in sources :

Example 1 with G_PROPS

use of main.content.values.properties.G_PROPS in project Eidolons by IDemiurge.

the class AbilityConstructor method checkAbilsMerge.

private static void checkAbilsMerge(Entity entity, boolean PASSIVES) {
    G_PROPS property = PASSIVES ? G_PROPS.PASSIVES : G_PROPS.ACTIVES;
    String prop = entity.getProperty(property);
    List<String> list = StringMaster.openContainer(prop);
    List<String> addList = new ArrayList<>();
    List<String> removeList = new ArrayList<>();
    for (String s : list) {
        String varPart = VariableManager.getVarPart(s);
        if (varPart.isEmpty()) {
            continue;
        }
        if (varPart.contains(",")) {
            continue;
        }
        String abilName = VariableManager.removeVarPart(s);
        // THEM?
        for (String s1 : StringMaster.open(prop.replaceFirst(abilName, ""))) {
            if (!VariableManager.removeVarPart(s1).equalsIgnoreCase(abilName)) {
                continue;
            }
            String mergedAbility = abilName + StringMaster.wrapInParenthesis(StringMaster.wrapInParenthesis(StringMaster.cropParenthesises(varPart)) + "+" + StringMaster.wrapInParenthesis(StringMaster.cropParenthesises(varPart)));
            removeList.add(s1);
            removeList.add(s);
            addList.add(mergedAbility);
        }
    }
    for (String s : removeList) {
        list.remove(s);
    }
    for (String s : addList) {
        list.add(s);
    }
    if (list.isEmpty())
        entity.removeProperty(property);
    else
        entity.setProperty(property, StringMaster.constructContainer(list));
}
Also used : ArrayList(java.util.ArrayList) G_PROPS(main.content.values.properties.G_PROPS)

Example 2 with G_PROPS

use of main.content.values.properties.G_PROPS in project Eidolons by IDemiurge.

the class CreationHelper method getRequiredValues.

public static List<VALUE> getRequiredValues(Entity t, boolean extended) {
    AT_OBJ_TYPE TYPE = (AT_OBJ_TYPE) t.getOBJ_TYPE_ENUM();
    List<VALUE> list = new ArrayList<>();
    for (VALUE l : ContentManager.getValuesForType(t.getOBJ_TYPE(), false)) {
        if (extended) {
            if (l.isLowPriority()) {
                continue;
            }
            list.add(l);
        } else if (l.isHighPriority()) {
            if (!(l instanceof G_PROPS)) {
                if (!(l instanceof G_PARAMS)) {
                    list.add(l);
                }
            }
        }
    }
    switch(TYPE) {
        case TASK:
            list.add(AT_PARAMS.GLORY);
            list.add(AT_PARAMS.TIME_ESTIMATED);
            break;
        case DAY:
        case DIRECTION:
        case GOAL:
        case SESSION:
    }
    if (TYPE.getChildValue() != null) {
        list.add(TYPE.getChildValue());
    }
    if (TYPE.getParentValue() != null) {
        list.add(TYPE.getParentValue());
    }
    if (TYPE.getGroupingKey() != G_PROPS.GROUP) {
        list.add(TYPE.getGroupingKey());
    }
    if (TYPE.getSubGroupingKey() != G_PROPS.GROUP) {
        list.add(TYPE.getSubGroupingKey());
    }
    return list;
}
Also used : ArrayList(java.util.ArrayList) VALUE(main.content.VALUE) G_PROPS(main.content.values.properties.G_PROPS) G_PARAMS(main.content.values.parameters.G_PARAMS)

Example 3 with G_PROPS

use of main.content.values.properties.G_PROPS in project Eidolons by IDemiurge.

the class DataManager method getChildren.

public static List<ObjType> getChildren(ObjType type, List<ObjType> data) {
    G_PROPS prop = G_PROPS.BASE_TYPE;
    G_PROPS prop2 = G_PROPS.NAME;
    return getChildren(type, data, prop, prop2);
}
Also used : G_PROPS(main.content.values.properties.G_PROPS)

Aggregations

G_PROPS (main.content.values.properties.G_PROPS)3 ArrayList (java.util.ArrayList)2 VALUE (main.content.VALUE)1 G_PARAMS (main.content.values.parameters.G_PARAMS)1