SequenceEffect class
Runs a list of child effects one after another in order.
The total durationTicks equals the sum of all children's durations.
Each child is active only during its own time slice; once it completes,
the next one begins. Child baselines are captured correctly because each
child's prevElapsed resets to 0 at the start of its slice.
SequenceEffect(children: [
MoveEffect(to: Vector3(200, 0, 0), durationTicks: 30),
ShakeEffect(amplitude: 8, durationTicks: 20),
FadeEffect(to: 0.0, durationTicks: 30),
])
- Inheritance
-
- Object
- DeterministicEffect
- SequenceEffect
Constructors
-
SequenceEffect({required List<
DeterministicEffect> children, bool loop = false, VoidCallback? onComplete, VoidCallback? onLoopComplete}) -
Plays
children(at least one, asserted) one after another in list order; lasts as long as all their durations added up.
Properties
-
children
→ List<
DeterministicEffect> -
Ordered child effects.
final
- durationTicks → int
-
Duration of this effect in fixed game-loop ticks.
finalinherited
- effectType → String
-
Unique string discriminator used by EffectSerializer.
no setteroverride
- hashCode → int
-
The hash code for this object.
no setterinherited
- loop ↔ bool
-
When
true, EffectPlayer resets and replays this effect indefinitely.getter/setter pairinherited - onComplete ↔ VoidCallback?
-
Called once when a non-looping effect reaches durationTicks.
getter/setter pairinherited
- onLoopComplete ↔ VoidCallback?
-
Called at the boundary of each completed loop iteration when loop is
true. Fire custom logic (sound, spawn) at each repeat.getter/setter pairinherited - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
applyTick(
EffectContext ctx, int prevElapsed, int currElapsed) → void -
Apply the effect delta covering ticks
prevElapsed→currElapsed.override -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
reset(
) → void -
Reset mutable state so the effect can be replayed by EffectPlayer
on loop restart.
override
-
tAt(
int elapsed) → double -
Normalised progress for
elapsedticks in[0.0, 1.0].inherited -
toJson(
) → Map< String, dynamic> -
Encode this effect's parameters to a JSON-compatible map.
override
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited