Modifier and Type | Field and Description |
---|---|
(package private) IEffect[] |
effects |
(package private) long |
length |
(package private) java.lang.Runnable |
onCancel |
(package private) java.lang.Runnable |
onStop |
Constructor and Description |
---|
ParallelEffect(IEffect[] effects)
Wrap several effects and start them in parallel.
|
ParallelEffect(IEffect[] effects,
java.lang.Runnable onStop,
java.lang.Runnable onCancel)
Wrap several effects and start them in parallel.
|
ParallelEffect(java.util.List<IEffect> effects)
Wrap several effects and start them in parallel.
|
ParallelEffect(java.util.List<IEffect> effects,
java.lang.Runnable onStop,
java.lang.Runnable onCancel)
Wrap several effects and start them in parallel.
|
Modifier and Type | Method and Description |
---|---|
void |
cancel()
Set the effect as done and run the cancel runnable.
|
void |
doEffect(long time)
Apply effect to the target according to the given time.
|
long |
getLength()
Get effect length
|
boolean |
isDone() |
IEffect[] effects
long length
java.lang.Runnable onCancel
java.lang.Runnable onStop
public ParallelEffect(IEffect[] effects)
effects
- public ParallelEffect(IEffect[] effects, java.lang.Runnable onStop, java.lang.Runnable onCancel)
effects
- onStop
- onCancel
- public ParallelEffect(java.util.List<IEffect> effects)
effects
- public ParallelEffect(java.util.List<IEffect> effects, java.lang.Runnable onStop, java.lang.Runnable onCancel)
effects
- onStop
- onCancel
- public void cancel()
IEffect
cancel
in interface IEffect
IEffect.cancel()
public void doEffect(long time)
IEffect
doEffect
in interface IEffect
time
- - Current time in ms. This value may be larger than the effect
length.IEffect.doEffect(long)
public long getLength()
IEffect
getLength
in interface IEffect
IEffect.getLength()
public boolean isDone()
isDone
in interface IEffect
IEffect.isDone()