public class DamageFunction extends Object implements ModifierFunction<DamageModifier>
Modifier and Type | Field and Description |
---|---|
static DoubleUnaryOperator |
ZERO_DAMAGE |
Constructor and Description |
---|
DamageFunction(DamageModifier modifier)
Creates a new
DamageFunction with the provided
DamageModifier . |
DamageFunction(DamageModifier modifier,
DoubleUnaryOperator function)
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o) |
DoubleUnaryOperator |
getFunction()
Gets the
DoubleUnaryOperator for this function. |
DamageModifier |
getModifier()
Gets the
DamageModifier for this function. |
int |
hashCode() |
static DamageFunction |
of(DamageModifier first,
DoubleUnaryOperator second)
Constructs a new damage function.
|
String |
toString() |
public static final DoubleUnaryOperator ZERO_DAMAGE
public DamageFunction(DamageModifier modifier)
DamageFunction
with the provided
DamageModifier
. The caveat is that the provided
DamageFunction
is by default going to provide 0
damage modifications.modifier
- The damage modifierpublic DamageFunction(DamageModifier modifier, DoubleUnaryOperator function)
modifier
- The modifierfunction
- The functionpublic static DamageFunction of(DamageModifier first, DoubleUnaryOperator second)
first
- The damage modifier to usesecond
- The unary operator to usepublic DamageModifier getModifier()
DamageModifier
for this function.getModifier
in interface ModifierFunction<DamageModifier>
public DoubleUnaryOperator getFunction()
DoubleUnaryOperator
for this function.getFunction
in interface ModifierFunction<DamageModifier>