public abstract class AbstractModifier extends java.lang.Object implements Modifier
| Modifier and Type | Field and Description |
|---|---|
protected float |
currentDuration
remaining duration
|
protected float |
duration
estimated duration
|
protected boolean |
finished
true if currentDuration leq 0
|
protected java.util.List<FinishListener> |
finishListenerList
list of
FinishListener |
protected ModifierCallback |
target
target which the modifier will affect
|
| Constructor and Description |
|---|
AbstractModifier(ModifierCallback target,
float duration)
Constructs an EntityModifier using given target and duration.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addFinishListener(FinishListener finishListener)
You can add a
FinishListener which will be called in
Modifier.onFinish(). |
boolean |
hasFinished()
Returns whether the modifier has finished
|
void |
kill()
Forces the modifier to stop
|
void |
onFinish()
Describes what happens on finish (last tick)
|
void |
reset()
Resets the modifier
|
void |
update()
Updates the modifier
|
protected final float duration
protected float currentDuration
protected final ModifierCallback target
protected boolean finished
protected java.util.List<FinishListener> finishListenerList
FinishListenerpublic AbstractModifier(ModifierCallback target, float duration)
target - targetduration - estimated durationpublic void update()
Modifierpublic void addFinishListener(FinishListener finishListener)
ModifierFinishListener which will be called in
Modifier.onFinish().addFinishListener in interface ModifierfinishListener - FinishListenerpublic boolean hasFinished()
ModifierhasFinished in interface Modifierpublic void onFinish()
Modifierpublic void kill()
Modifier