Search in sources :

Example 21 with PROPERTY

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

the class ContentManager method init.

public static void init(ArrayList<PROPERTY> propz, ArrayList<PARAMETER> paramz) {
    props = propz;
    params = paramz;
    sparams = new ArrayList<>(params.size());
    sprops = new ArrayList<>(props.size());
    propCache = new HashMap<>(props.size() * 3 / 2);
    for (PROPERTY p : props) {
        String name = p.getName();
        sprops.add(name);
        if (LOWER_CASE_CACHED)
            name = name.toLowerCase();
        propCache.put(name, p);
    }
    paramCache = new HashMap<>(params.size() * 3 / 2);
    for (PARAMETER p : params) {
        String name = p.getName();
        sparams.add(name);
        if (LOWER_CASE_CACHED)
            name = name.toLowerCase();
        paramCache.put(name, p);
        if (p.isAttribute()) {
            getAttributes().add(p);
        }
        if (p.isMastery()) {
            if (p instanceof Param) {
                getMasteryScores().add(p);
            } else {
                getMasteries().add(p);
            }
        }
        if (checkParamPerLevel(p)) {
            getPerLevelParams().add(p);
        }
    }
// Collections.sort(props, new DefaultComparator<PROPERTY>());
// Collections.sort(params, new DefaultComparator<PARAMETER>());
}
Also used : PROPERTY(main.content.values.properties.PROPERTY) Param(main.content.values.parameters.Param) PARAMETER(main.content.values.parameters.PARAMETER)

Example 22 with PROPERTY

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

the class ContentManager method getPropsForType.

public static List<PROPERTY> getPropsForType(String entity, boolean dynamic) {
    List<PROPERTY> propList = (dynamic) ? propListsMap.get(entity) : propListsMapAV.get(entity);
    if (propList != null) {
        return propList;
    }
    propList = new ArrayList<>();
    for (PROPERTY prop : props) {
        if (!dynamic) {
            if (prop.isDynamic() && !prop.isWriteToType()) {
                continue;
            }
        }
        if (isValueForOBJ_TYPE(entity, prop)) {
            propList.add(prop);
        }
    }
    if (!dynamic) {
        propListsMapAV.put(entity, propList);
    } else {
        propListsMap.put(entity, propList);
    }
    return propList;
}
Also used : PROPERTY(main.content.values.properties.PROPERTY)

Example 23 with PROPERTY

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

the class ContentManager method getValue.

public static VALUE getValue(String valueName, boolean extensiveSearch) {
    if (StringMaster.isEmpty(valueName)) {
        return null;
    }
    if (LOWER_CASE_CACHED)
        valueName = valueName.toLowerCase();
    VALUE v = propCache.get(valueName);
    if (v != null) {
        if (!checkExcluded(v)) {
            return v;
        }
    }
    v = paramCache.get(valueName);
    if (v != null) {
        if (!checkExcluded(v)) {
            return v;
        }
    }
    v = getPROP(valueName, true);
    if (v == null) {
        v = getPARAM(valueName, true);
    }
    if (v == null) {
        if (extensiveSearch) {
            v = getPROP(valueName, false);
            if (v == null) {
                v = getPARAM(valueName, false);
            }
            PROPERTY prop = findPROP(valueName);
            PARAMETER param = findPARAM(valueName);
            if (prop != null && param != null) {
                v = StringMaster.compareSimilar(prop.toString(), valueName) >= StringMaster.compareSimilar(param.toString(), valueName) ? prop : param;
            } else if (prop != null) {
                v = prop;
            } else {
                v = param;
            }
        // //compare length difference?
        // //cache key to value
        }
        if (v == null) {
            LogMaster.log(LogMaster.CORE_DEBUG, "VALUE NOT FOUND: " + valueName);
        }
    }
    return v;
}
Also used : PROPERTY(main.content.values.properties.PROPERTY) PARAMETER(main.content.values.parameters.PARAMETER)

Example 24 with PROPERTY

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

the class ContentManager method getPropNames.

public static List<String> getPropNames(String entity, boolean dynamic) {
    List<String> propList = (dynamic) ? spropListsMap.get(entity) : spropListsMapAV.get(entity);
    if (propList != null) {
        return propList;
    }
    propList = new ArrayList<>();
    for (PROPERTY prop : getPropsForType(entity, dynamic)) {
        propList.add(prop.getName());
    }
    if (!dynamic) {
        spropListsMapAV.put(entity, propList);
    } else {
        spropListsMap.put(entity, propList);
    }
    return propList;
}
Also used : PROPERTY(main.content.values.properties.PROPERTY)

Example 25 with PROPERTY

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

the class EffectFinder method initPropModEffects.

public static Effects initPropModEffects(String modString, Ref ref) {
    Effects modEffects = new Effects();
    Map<PROPERTY, String> map = new RandomWizard<PROPERTY>().constructStringWeightMap(modString, PROPERTY.class);
    initPropModEffects(modEffects, map, ref);
    return modEffects;
}
Also used : PROPERTY(main.content.values.properties.PROPERTY) Effects(main.ability.effects.Effects)

Aggregations

PROPERTY (main.content.values.properties.PROPERTY)57 PARAMETER (main.content.values.parameters.PARAMETER)23 ObjType (main.entity.type.ObjType)17 OBJ_TYPE (main.content.OBJ_TYPE)6 ArrayList (java.util.ArrayList)5 VALUE (main.content.VALUE)5 Ref (main.entity.Ref)5 DC_TYPE (main.content.DC_TYPE)4 Node (org.w3c.dom.Node)4 DC_SpellObj (eidolons.entity.active.DC_SpellObj)3 Unit (eidolons.entity.obj.unit.Unit)3 XLinkedMap (main.data.XLinkedMap)3 Obj (main.entity.obj.Obj)3 EnumMaster (main.system.auxiliary.EnumMaster)3 AddBuffEffect (eidolons.ability.effects.attachment.AddBuffEffect)2 ModifyPropertyEffect (eidolons.ability.effects.common.ModifyPropertyEffect)2 File (java.io.File)2 List (java.util.List)2 ConcurrentHashMap (java.util.concurrent.ConcurrentHashMap)2 MOD_PROP_TYPE (main.ability.effects.Effect.MOD_PROP_TYPE)2