Package studio.magemonkey.fabled.manager
Class AttributeValue
java.lang.Object
studio.magemonkey.fabled.manager.AttributeValue
Represents one formula modifier for an attribute
that can have conditions
-
Constructor Summary
ConstructorsConstructorDescriptionAttributeValue
(String data) Loads the attribute value that starts with the formula and can have as many conditions as desired after -
Method Summary
Modifier and TypeMethodDescriptiondouble
apply
(double value, int amount) Checks the conditions for the given componentboolean
passes
(EffectComponent component) Checks whether the formula should be applied to the component
-
Constructor Details
-
AttributeValue
Loads the attribute value that starts with the formula and can have as many conditions as desired after- Parameters:
data
- data string for the value
-
-
Method Details
-
passes
Checks whether the formula should be applied to the component- Parameters:
component
- component to check for conditions against- Returns:
- true if passes the conditions
-
apply
public double apply(double value, int amount) Checks the conditions for the given component- Parameters:
value
- base valueamount
- amount of attribute points- Returns:
- the modified value if the conditions passed or the base value if they failed
-