use of main.content.values.parameters.PARAMETER in project Eidolons by IDemiurge.
the class DataModel method modifyParameter.
public void modifyParameter(String param, String string) {
PARAMETER p = ContentManager.getPARAM(param);
int perc = StringMaster.getInteger(string);
modifyParameter(p, perc);
}
use of main.content.values.parameters.PARAMETER in project Eidolons by IDemiurge.
the class DataModel method cloneParamMap.
protected ParamMap cloneParamMap(Map<PARAMETER, String> map) {
ParamMap clone = new ParamMap();
Map<PARAMETER, String> innerMap = new HashMap<>();
innerMap.putAll(map);
clone.setMap(innerMap);
return clone;
}
use of main.content.values.parameters.PARAMETER in project Eidolons by IDemiurge.
the class DataModel method cloneMapsWithExceptions.
public void cloneMapsWithExceptions(DataModel type, VALUE... exceptions) {
Map<VALUE, String> map = new HashMap<>();
for (VALUE exception : exceptions) {
map.put(exception, getValue(exception));
}
this.propMap = clonePropMap(type.getPropMap().getMap());
this.paramMap = cloneParamMap(type.getParamMap().getMap());
for (VALUE exception : exceptions) {
String value = map.get(exception);
if (exception instanceof PARAMETER) {
paramMap.put(exception.getName(), value);
} else if (exception instanceof PROPERTY) {
propMap.put(exception.getName(), value);
}
}
setDirty(true);
}
use of main.content.values.parameters.PARAMETER in project Eidolons by IDemiurge.
the class DataModel method mergeValues.
public void mergeValues(Entity type, VALUE... vals) {
for (VALUE val : vals) {
if (val instanceof PROPERTY) {
PROPERTY property = (PROPERTY) val;
addProperty(property, type.getProperty(property), true);
} else {
if (val instanceof PARAMETER) {
PARAMETER parameter = (PARAMETER) val;
addParam(parameter, type.getParam(parameter), false);
}
}
}
}
use of main.content.values.parameters.PARAMETER in project Eidolons by IDemiurge.
the class DataModel method resetCurrentValue.
protected void resetCurrentValue(PARAMETER base_p) {
base_p = ContentManager.getBaseParameterFromCurrent(base_p);
PARAMETER c_p = ContentManager.getCurrentParam(base_p);
PARAMETER c_perc = ContentManager.getPercentageParam(base_p);
int percentage = getIntParam(c_perc);
int base_value = getIntParam(base_p);
int c_value = MathMaster.getFractionValue(base_value, percentage);
setParam(c_p, c_value, true);
LogMaster.log(LogMaster.VALUE_DEBUG, getName() + "'s " + base_p.getName() + " current value reset: " + percentage + "% out of " + base_value + " = " + c_value);
}
Aggregations