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.
Constructor Summary
Constructors Constructor Description AttributeModifier(Modification mod, double modifyValue)
Initializes a new instance of theAttributeModifier
class.Method Summary
Modifier and Type Method Description int
compareTo(AttributeModifier<T> otherModifier)
boolean
equals(java.lang.Object obj)
Modification
getModification()
Gets the modification type applied by this modifier.double
getModifyValue()
Gets the value that is used to modify an attribute.int
hashCode()
boolean
isActive()
T
modify(T modvalue)
void
setActive(boolean active)
void
setModifyValue(double value)
Constructor Details
AttributeModifier
Initializes a new instance of theAttributeModifier
class.- Parameters:
mod
- The modification type.modifyValue
- The modification value to be applied by this instance.
Method Details
compareTo
- Specified by:
compareTo
in interfacejava.lang.Comparable<T extends java.lang.Number>
equals
public boolean equals(java.lang.Object obj)- Overrides:
equals
in classjava.lang.Object
hashCode
public int hashCode()- Overrides:
hashCode
in classjava.lang.Object
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)