Formatting

This commit is contained in:
Lukas Klingsbo
2020-10-04 21:56:04 +02:00
committed by Lukas Klingsbo
parent 18048b16a3
commit eb70fe72d8
3 changed files with 9 additions and 10 deletions

View File

@ -35,7 +35,7 @@ abstract class PositionComponentEffect {
Vector2 originalPosition;
double originalAngle;
Vector2 originalSize;
/// Used to be able to determine the end state of a sequence of effects
Vector2 endPosition;
double endAngle;

View File

@ -52,7 +52,7 @@ class MoveEffect extends PositionComponentEffect {
if (isRelative) {
Vector2 lastPosition = _startPosition;
_movePath = [];
for(Vector2 v in path) {
for (Vector2 v in path) {
final nextPosition = v + lastPosition;
_movePath.add(nextPosition);
lastPosition = nextPosition;
@ -92,11 +92,11 @@ class MoveEffect extends PositionComponentEffect {
}
travelTime = pathLength / speed;
}
@override
void reset() {
super.reset();
if(_percentagePath?.isNotEmpty ?? false) {
if (_percentagePath?.isNotEmpty ?? false) {
_currentSubPath = _percentagePath.first;
}
}
@ -117,7 +117,6 @@ class MoveEffect extends PositionComponentEffect {
final double localPercentage =
(progress - lastEndAt) / (_currentSubPath.endAt - lastEndAt);
component.position = _currentSubPath.previous +
((_currentSubPath.v - _currentSubPath.previous) *
localPercentage);
((_currentSubPath.v - _currentSubPath.previous) * localPercentage);
}
}

View File

@ -63,9 +63,9 @@ class SequenceEffect extends PositionComponentEffect {
_driftModifier = currentEffect.driftTime;
_currentIndex++;
final iterationSize = isAlternating ? effects.length * 2 : effects.length;
if (_currentIndex != 0
&& _currentIndex == iterationSize
&& (currentEffect.isAlternating ||
if (_currentIndex != 0 &&
_currentIndex == iterationSize &&
(currentEffect.isAlternating ||
currentEffect.isAlternating == isAlternating)) {
isInfinite ? reset() : dispose();
return;
@ -93,7 +93,7 @@ class SequenceEffect extends PositionComponentEffect {
void reset() {
super.reset();
effects.forEach((e) => e.reset());
if(component != null) {
if (component != null) {
component.position = originalPosition;
component.angle = originalAngle;
component.size = originalSize;