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>());
}
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;
}
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;
}
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;
}
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;
}
Aggregations