Class RangeAttribute<T extends Number>

java.lang.Object
de.gurkenlabs.litiengine.attributes.Attribute<T>
de.gurkenlabs.litiengine.attributes.RangeAttribute<T>

public class RangeAttribute<T extends Number> extends Attribute<T>
  • Constructor Details

    • RangeAttribute

      public RangeAttribute(T maxValue, T minValue, T baseValue)
      Initializes a new instance of the RangeAttribute class.
      Parameters:
      maxValue - The max value of this attribute.
      minValue - The min value of this attribute
      baseValue - The base (initial) value of this attribute
  • Method Details

    • addMinModifier

      public void addMinModifier(AttributeModifier<T> modifier)
    • addMaxModifier

      public void addMaxModifier(AttributeModifier<T> modifier)
    • get

      public T get()
      Description copied from class: Attribute
      Gets the current value of this attribute, respecting all the registered AttributeModifiers.
      Overrides:
      get in class Attribute<T extends Number>
      Returns:
      The current value of this attribute.
    • getMin

      public T getMin()
    • getMax

      public T getMax()
    • getRelativeCurrentValue

      public float getRelativeCurrentValue()
    • modifyBaseValue

      public void modifyBaseValue(AttributeModifier<T> modifier)
      Description copied from class: Attribute
      Adjusts the base value of this attribute once with the specified modifier.
      Overrides:
      modifyBaseValue in class Attribute<T extends Number>
      Parameters:
      modifier - The modifier used to adjust this attribute's base value.
      See Also:
    • modifyMaxBaseValue

      public void modifyMaxBaseValue(AttributeModifier<T> modifier)
    • setToMin

      public void setToMin()
    • setToMax

      public void setToMax()
    • setMaxBaseValue

      public void setMaxBaseValue(T maxValue)
    • setMinBaseValue

      public void setMinBaseValue(T minValue)
    • getMinModifiers

      protected List<AttributeModifier<T>> getMinModifiers()
    • getMaxModifiers

      protected List<AttributeModifier<T>> getMaxModifiers()
    • applyMinModifiers

      protected T applyMinModifiers(T maxValue)
    • applyMaxModifiers

      protected T applyMaxModifiers(T maxValue)