forked from perelman/contra-renderer
Daniel Perelman
9fbf7d18ac
Currently just copied over the existing code and applied the quick fixes to get it to compile. Each move should be refactored to be handle its parameters earlier where applicable. But variants support should probably be added first so both refactors can happen together.
33 lines
1.3 KiB
TypeScript
33 lines
1.3 KiB
TypeScript
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<ButterflyWhirl, typeof moveName> {
|
|
moveAsLowLevelMoves(): LowLevelMovesForAllDancers {
|
|
return this.handleCircleMove(({ startPos }) => {
|
|
return this.combine([{
|
|
beats: this.move.beats,
|
|
endPosition: startPos,
|
|
movementPattern: {
|
|
kind: SemanticAnimationKind.RotateAround,
|
|
around: startPos.which.leftRightSide(),
|
|
// TODO hand around isn't the same as allemande...
|
|
byHand: startPos.which.isOnLeftLookingAcross() ? Hand.Right : Hand.Left,
|
|
close: true,
|
|
minAmount: 360,
|
|
}
|
|
}], startPos);
|
|
});
|
|
}
|
|
}
|
|
|
|
class ButterflyWhirl extends MoveInterpreter<typeof moveName> {
|
|
buildSingleVariantMoveInterpreter(startingPos: SemanticPositionsForAllDancers): ISingleVariantMoveInterpreter {
|
|
return new ButterflyWhirlSingleVariant(this, startingPos);
|
|
}
|
|
}
|
|
|
|
moveInterpreters.set(moveName, ButterflyWhirl); |