Class RangeAttribute<T extends java.lang.Number>
java.lang.Object
de.gurkenlabs.litiengine.attributes.Attribute<T>
de.gurkenlabs.litiengine.attributes.RangeAttribute<T>
public class RangeAttribute<T extends java.lang.Number>
extends Attribute<T>Constructor Summary
Constructors Constructor Description RangeAttribute(T maxValue, T minValue, T baseValue)Initializes a new instance of theRangeAttributeclass.Method Summary
Modifier and Type Method Description voidaddMaxModifier(AttributeModifier<T> modifier)voidaddMinModifier(AttributeModifier<T> modifier)protected TapplyMaxModifiers(T maxValue)protected TapplyMinModifiers(T maxValue)Tget()Gets the current value of this attribute, respecting all the registeredAttributeModifiers.TgetMax()protected java.util.List<AttributeModifier<T>>getMaxModifiers()TgetMin()protected java.util.List<AttributeModifier<T>>getMinModifiers()floatgetRelativeCurrentValue()voidmodifyBaseValue(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 java.lang.Number>- Parameters:
modifier- The modifier used to adjust this attribute's base value.- See Also:
Attribute.getBase(),Attribute.setBaseValue(Number)
modifyMaxBaseValue
setToMin
public void setToMin()setToMax
public void setToMax()setMaxBaseValue
setMinBaseValue
getMinModifiers
getMaxModifiers
applyMinModifiers
applyMaxModifiers
