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 Summary
ConstructorsConstructorDescriptionAttributeModifier(Modification mod, double modifyValue) Initializes a new instance of theAttributeModifierclass. -
Method Summary
Modifier and TypeMethodDescriptionintcompareTo(AttributeModifier<T> otherModifier) booleanGets the modification type applied by this modifier.doubleGets the value that is used to modify an attribute.inthashCode()booleanisActive()voidsetActive(boolean active) voidsetModifyValue(double value)
-
Constructor Details
-
AttributeModifier
Initializes a new instance of theAttributeModifierclass.- Parameters:
mod- The modification type.modifyValue- The modification value to be applied by this instance.
-
-
Method Details
-
compareTo
- Specified by:
compareToin interfaceComparable<T extends Number>
-
equals
-
hashCode
public int hashCode() -
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
-
setModifyValue
public void setModifyValue(double value) -
setActive
public void setActive(boolean active)
-