Class RangeAttribute<T extends Number>
java.lang.Object
de.gurkenlabs.litiengine.attributes.Attribute<T>
de.gurkenlabs.litiengine.attributes.RangeAttribute<T>
-
Constructor Summary
ConstructorsConstructorDescriptionRangeAttribute(T maxValue, T minValue, T baseValue) Initializes a new instance of theRangeAttributeclass. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddMaxModifier(AttributeModifier<T> modifier) voidaddMinModifier(AttributeModifier<T> modifier) protected TapplyMaxModifiers(T maxValue) protected TapplyMinModifiers(T maxValue) get()Gets the current value of this attribute, respecting all the registeredAttributeModifiers.getMax()protected List<AttributeModifier<T>> getMin()protected List<AttributeModifier<T>> floatvoidmodifyBaseValue(AttributeModifier<T> modifier) Adjusts the base value of this attribute once with the specified modifier.voidmodifyMaxBaseValue(AttributeModifier<T> modifier) voidsetMaxBaseValue(T maxValue) voidsetMinBaseValue(T minValue) voidsetToMax()voidsetToMin()Methods inherited from class de.gurkenlabs.litiengine.attributes.Attribute
addModifier, applyModifiers, getBase, getModifiers, isModifierApplied, modifyBaseValue, removeModifier, setBaseValue, toString
-
Constructor Details
-
RangeAttribute
Initializes a new instance of theRangeAttributeclass.- Parameters:
maxValue- The max value of this attribute.minValue- The min value of this attributebaseValue- The base (initial) value of this attribute
-
-
Method Details
-
addMinModifier
-
addMaxModifier
-
get
Description copied from class:AttributeGets the current value of this attribute, respecting all the registeredAttributeModifiers. -
getMin
-
getMax
-
getRelativeCurrentValue
public float getRelativeCurrentValue() -
modifyBaseValue
Description copied from class:AttributeAdjusts the base value of this attribute once with the specified modifier.- Overrides:
modifyBaseValuein classAttribute<T extends Number>- Parameters:
modifier- The modifier used to adjust this attribute's base value.- See Also:
-
modifyMaxBaseValue
-
setToMin
public void setToMin() -
setToMax
public void setToMax() -
setMaxBaseValue
-
setMinBaseValue
-
getMinModifiers
-
getMaxModifiers
-
applyMinModifiers
-
applyMaxModifiers
-