Class AttributeModifier<T extends Number>

java.lang.Object
de.gurkenlabs.litiengine.attributes.AttributeModifier<T>
Type Parameters:
T - the generic type
All Implemented Interfaces:
Comparable<AttributeModifier<T>>

public class AttributeModifier<T extends Number> extends Object implements Comparable<AttributeModifier<T>>
An attribute modifier allows to modify attributes by the specified Modification and modify value.
See Also:
  • Constructor Details

    • AttributeModifier

      public AttributeModifier(Modification mod, double modifyValue)
      Initializes a new instance of the AttributeModifier class.
      Parameters:
      mod - The modification type.
      modifyValue - The modification value to be applied by this instance.
  • Method Details

    • compareTo

      public int compareTo(AttributeModifier<T> otherModifier)
      Specified by:
      compareTo in interface Comparable<T extends Number>
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • getModification

      public Modification getModification()
      Gets the modification type applied by this modifier.
      Returns:
      The modification type applied by this modifier.
    • getModifyValue

      public double getModifyValue()
      Gets the value that is used to modify an attribute.
      Returns:
      The value that is used to modify an attribute.
    • isActive

      public boolean isActive()
    • modify

      public T modify(T modvalue)
    • setModifyValue

      public void setModifyValue(double value)
    • setActive

      public void setActive(boolean active)