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.

See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the type of attribute this modifier affects.
    modify(T currentValue)
    Modifies the current value of the attribute.
  • Method Details

    • modify

      T modify(T currentValue)
      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 AttributeType of the attribute being modified