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