Class DamageFunction
java.lang.Object
org.spongepowered.api.event.cause.entity.damage.DamageFunction
- All Implemented Interfaces:
ModifierFunction<DamageModifier>
-
Field Summary
-
Constructor Summary
ConstructorDescriptionDamageFunction
(DamageModifier modifier) Creates a newDamageFunction
with the providedDamageModifier
.DamageFunction
(DamageModifier modifier, DoubleUnaryOperator function) -
Method Summary
Modifier and TypeMethodDescriptionboolean
function()
Gets theDoubleUnaryOperator
for this function.int
hashCode()
modifier()
Gets theDamageModifier
for this function.static DamageFunction
of
(DamageModifier first, DoubleUnaryOperator second) Constructs a new damage function.toString()
-
Field Details
-
ZERO_DAMAGE
-
-
Constructor Details
-
DamageFunction
Creates a newDamageFunction
with the providedDamageModifier
. The caveat is that the providedDamageFunction
is by default going to provide0
damage modifications.- Parameters:
modifier
- The damage modifier
-
DamageFunction
- Parameters:
modifier
- The modifierfunction
- The function
-
-
Method Details
-
of
Constructs a new damage function.- Parameters:
first
- The damage modifier to usesecond
- The unary operator to use- Returns:
- The resulting damage function
-
modifier
Gets theDamageModifier
for this function.- Specified by:
modifier
in interfaceModifierFunction<DamageModifier>
- Returns:
- The damage modifier
-
function
Gets theDoubleUnaryOperator
for this function.- Specified by:
function
in interfaceModifierFunction<DamageModifier>
- Returns:
- The damage function
-
toString
-
equals
-
hashCode
public int hashCode()
-