mirror of
https://github.com/flame-engine/flame.git
synced 2025-11-01 19:12:31 +08:00
Assert message for speed or duration needed
This commit is contained in:
@ -166,7 +166,10 @@ abstract class SimplePositionComponentEffect extends PositionComponentEffect {
|
||||
Curve curve,
|
||||
bool isRelative = false,
|
||||
void Function() onComplete,
|
||||
}) : assert(duration != null || speed != null),
|
||||
}) : assert(
|
||||
duration != null || speed != null,
|
||||
"Either speed or duration necessary",
|
||||
),
|
||||
super(
|
||||
initialIsInfinite,
|
||||
initialIsAlternating,
|
||||
|
||||
@ -33,7 +33,10 @@ class MoveEffect extends SimplePositionComponentEffect {
|
||||
bool isAlternating = false,
|
||||
bool isRelative = false,
|
||||
void Function() onComplete,
|
||||
}) : assert(duration != null || speed != null),
|
||||
}) : assert(
|
||||
duration != null || speed != null,
|
||||
"Either speed or duration necessary",
|
||||
),
|
||||
super(
|
||||
isInfinite,
|
||||
isAlternating,
|
||||
|
||||
@ -17,7 +17,10 @@ class RotateEffect extends SimplePositionComponentEffect {
|
||||
bool isAlternating = false,
|
||||
bool isRelative = false,
|
||||
void Function() onComplete,
|
||||
}) : assert(duration != null || speed != null),
|
||||
}) : assert(
|
||||
duration != null || speed != null,
|
||||
"Either speed or duration necessary",
|
||||
),
|
||||
super(
|
||||
isInfinite,
|
||||
isAlternating,
|
||||
|
||||
@ -18,7 +18,10 @@ class ScaleEffect extends SimplePositionComponentEffect {
|
||||
bool isAlternating = false,
|
||||
bool isRelative = false,
|
||||
void Function() onComplete,
|
||||
}) : assert(duration != null || speed != null),
|
||||
}) : assert(
|
||||
duration != null || speed != null,
|
||||
"Either speed or duration necessary",
|
||||
),
|
||||
super(
|
||||
isInfinite,
|
||||
isAlternating,
|
||||
|
||||
Reference in New Issue
Block a user