Interface AttributeModifier<T extends Number>
- Type Parameters:
T- the numeric type of the attribute being modified (e.g., Integer, Float)
- All Known Implementing Classes:
SprintModifier
public interface AttributeModifier<T extends Number>
Represents a modifier that can change the value of a specific attribute.
AttributeModifier allows dynamic adjustments to an entity's attributes,
such as health, mana, or speed, by applying a modification to the current value.
-
Method Summary
Modifier and TypeMethodDescriptionReturns the type of attribute this modifier affects.Modifies the current value of the attribute.
-
Method Details
-
modify
Modifies the current value of the attribute.Implementations define the logic for how the value is altered, such as adding, multiplying, or applying more complex formulas.
- Parameters:
currentValue- the current value of the attribute before modification- Returns:
- the new modified value
-
getAttributeType
AttributeType getAttributeType()Returns the type of attribute this modifier affects.- Returns:
- the
AttributeTypeof the attribute being modified
-