Class AttributeModifier<T extends java.lang.Number>

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

public class AttributeModifier<T extends java.lang.Number>
extends java.lang.Object
implements java.lang.Comparable<AttributeModifier<T>>
An attribute modifier allows to modify attributes by the specified Modification and modify value.
See Also:
Attribute.addModifier(AttributeModifier), Attribute.modifyBaseValue(AttributeModifier)
  • 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 java.lang.Comparable<T extends java.lang.Number>
    • equals

      public boolean equals​(java.lang.Object obj)
      Overrides:
      equals in class java.lang.Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class java.lang.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)