Class AbstractModifierEvent<T extends ModifierFunction<M>,M>
- java.lang.Object
-
- org.spongepowered.api.event.impl.AbstractEvent
-
- org.spongepowered.api.event.impl.entity.AbstractModifierEvent<T,M>
-
- Type Parameters:
T
- The modifier type to use
- All Implemented Interfaces:
Event
- Direct Known Subclasses:
AbstractAttackEntityEvent
,AbstractDamageEntityEvent
public abstract class AbstractModifierEvent<T extends ModifierFunction<M>,M> extends AbstractEvent
An abstract base class for implementations ofDamageEntityEvent
.
-
-
Field Summary
Fields Modifier and Type Field Description protected List<T>
modifierFunctions
protected LinkedHashMap<M,Double>
modifiers
protected double
originalFinalAmount
protected Map<M,Double>
originalModifierMap
protected List<Tuple<M,Double>>
originalModifiers
-
Fields inherited from class org.spongepowered.api.event.impl.AbstractEvent
currentOrder
-
-
Constructor Summary
Constructors Constructor Description AbstractModifierEvent()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract T
convertTuple(M obj, DoubleUnaryOperator function)
protected double
finalAmount(double baseAmount)
protected ImmutableList<T>
init(double originalValue, List<T> originalFunctions)
List<T>
modifiers()
Gets the modifiers affecting this event.protected void
recalculateDamages(double baseAmount)
-
Methods inherited from class org.spongepowered.api.event.impl.AbstractEvent
init
-
-
-
-
Field Detail
-
originalFinalAmount
protected double originalFinalAmount
-
modifiers
protected final LinkedHashMap<M,Double> modifiers
-
modifierFunctions
protected final List<T extends ModifierFunction<M>> modifierFunctions
-
-
Method Detail
-
init
protected ImmutableList<T> init(double originalValue, List<T> originalFunctions)
-
convertTuple
protected abstract T convertTuple(M obj, DoubleUnaryOperator function)
-
recalculateDamages
protected void recalculateDamages(double baseAmount)
-
finalAmount
protected double finalAmount(double baseAmount)
-
-