Let the user choose if the sequence should get stuck

This commit is contained in:
Lukas Klingsbo
2020-05-28 20:27:44 +02:00
parent 884e82956a
commit df9bdc785d
2 changed files with 1 additions and 4 deletions

View File

@ -72,7 +72,7 @@ This effect is a combination of other effects. You provide it with a list of you
The effects in the list should only be passed to the SequenceEffect, never added to a PositionComponent with `addEffect`.
Note that no effects added to the sequence can have their `isInfinite` property set to `true`, because then naturally the sequence will get stuck once it gets to that effect.
Note that no effect (except the last) added to the sequence should have their `isInfinite` property set to `true`, because then naturally the sequence will get stuck once it gets to that effect.
You can make the sequence go in a loop by setting both `isInfinite: true` and `isAlternating: true`.

View File

@ -15,9 +15,6 @@ class SequenceEffect extends PositionComponentEffect {
isInfinite = false,
isAlternating = false,
}) : super(isInfinite, isAlternating) {
/// All effects need to be finite, otherwise the sequence will get stuck
assert(effects.every((effect) => !effect.isInfinite));
/// No effects can be added to components from the start
assert(effects.every((effect) => effect.component == null));
}