Search in sources :

Example 76 with PARAMETER

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);
}
Also used : PARAMETER(main.content.values.parameters.PARAMETER)

Example 77 with PARAMETER

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;
}
Also used : ParamMap(main.content.values.parameters.ParamMap) HashMap(java.util.HashMap) ConcurrentHashMap(java.util.concurrent.ConcurrentHashMap) PARAMETER(main.content.values.parameters.PARAMETER)

Example 78 with PARAMETER

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);
}
Also used : HashMap(java.util.HashMap) ConcurrentHashMap(java.util.concurrent.ConcurrentHashMap) PROPERTY(main.content.values.properties.PROPERTY) VALUE(main.content.VALUE) PARAMETER(main.content.values.parameters.PARAMETER)

Example 79 with PARAMETER

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);
            }
        }
    }
}
Also used : PROPERTY(main.content.values.properties.PROPERTY) VALUE(main.content.VALUE) PARAMETER(main.content.values.parameters.PARAMETER)

Example 80 with PARAMETER

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);
}
Also used : PARAMETER(main.content.values.parameters.PARAMETER)

Aggregations

PARAMETER (main.content.values.parameters.PARAMETER)136 PROPERTY (main.content.values.properties.PROPERTY)22 ObjType (main.entity.type.ObjType)13 ArrayList (java.util.ArrayList)12 Formula (main.system.math.Formula)12 Ref (main.entity.Ref)9 VALUE (main.content.VALUE)7 Obj (main.entity.obj.Obj)7 PARAMS (eidolons.content.PARAMS)6 ModifyValueEffect (eidolons.ability.effects.common.ModifyValueEffect)5 Cost (main.elements.costs.Cost)5 DC_ActiveObj (eidolons.entity.active.DC_ActiveObj)4 G_Panel (main.swing.generic.components.G_Panel)4 Node (org.w3c.dom.Node)4 AddBuffEffect (eidolons.ability.effects.attachment.AddBuffEffect)3 HashMap (java.util.HashMap)3 DAMAGE_TYPE (main.content.enums.GenericEnums.DAMAGE_TYPE)3 Costs (main.elements.costs.Costs)3 Entity (main.entity.Entity)3 GraphicComponent (main.swing.generic.components.misc.GraphicComponent)3