import { RotationAnimationFacing } from "../animation.js"; import { Move } from "../libfigureMapper.js"; import { SemanticAnimationKind } from "../lowLevelMove.js"; import { Hand } from "../rendererConstants.js"; import { ISingleVariantMoveInterpreter, LowLevelMovesForAllDancers, MoveInterpreter, SemanticPositionsForAllDancers, SingleVariantMoveInterpreter, moveInterpreters } from "./_moveInterpreter.js"; const moveName: Move["move"] = "butterfly whirl"; class ButterflyWhirlSingleVariant extends SingleVariantMoveInterpreter { moveAsLowLevelMoves(): LowLevelMovesForAllDancers { return this.handleCircleMove(({ startPos }) => { return this.combine([{ beats: this.move.beats, endPosition: startPos, movementPattern: { kind: SemanticAnimationKind.RotateAround, around: startPos.which.leftRightSide(), byHand: startPos.which.isOnLeftLookingAcross() ? Hand.Right : Hand.Left, facing: startPos.which.isOnLeftLookingAcross() ? RotationAnimationFacing.Forward : RotationAnimationFacing.Backward, close: true, minAmount: 360, } }], startPos); }); } } class ButterflyWhirl extends MoveInterpreter { override allowStartingClose(): boolean { return true; } buildSingleVariantMoveInterpreter(startingPos: SemanticPositionsForAllDancers): ISingleVariantMoveInterpreter { return new ButterflyWhirlSingleVariant(this, startingPos); } } moveInterpreters.set(moveName, ButterflyWhirl);