universal-siteswap
Version:
A library for parsing, validating, examining and finding transitions between all types of siteswaps
54 lines (53 loc) • 2.2 kB
TypeScript
import { Hand, Position } from './common';
import { Siteswap } from './siteswap';
export declare class JugglerStateBeat {
LH: number;
RH: number;
constructor(LH?: number, RH?: number);
increment(hand: Hand): void;
decrement(hand: Hand): void;
val(hand: Hand): number;
isSync(): boolean;
isEmpty(): boolean;
flip(): JugglerStateBeat;
isLessOrEqual(other: JugglerStateBeat): boolean;
toString(sync: boolean): string;
}
export declare class JugglerState {
beats: JugglerStateBeat[];
constructor(beats: JugglerStateBeat[]);
static Empty(maxHeight: number): JugglerState;
removeTrailingZeros(): void;
isPureAsync(): boolean;
flip(): JugglerState;
toString(): string;
}
export declare class State {
jugglers: JugglerState[];
jugglerDelays: number[];
isGround: boolean;
numObjects: number;
numJugglers: number;
maxHeight: number;
constructor(jugglers: JugglerState[], trimZeros?: boolean, jugglerDelays?: number[]);
recalc(): void;
trimZeros(): void;
at(position: Position): number;
inc(position: Position): void;
dec(position: Position): void;
flip(): State;
toString(): string;
entry(from?: State, sync?: boolean, allowFlipped?: boolean): Siteswap;
exit(to?: State, sync?: boolean, allowFlipped?: boolean): Siteswap;
globalStateBeat(time: number): JugglerStateBeat[];
static GroundState(numObjects: number, sync?: boolean, numJugglers?: number): State;
static Empty(numJugglers: number, maxHeight: number): State;
static IsTransitionValid(s1: State, s2: State): void;
static IsShiftValid(s1: State, s2: State, shift: number): boolean;
static ShortestTransitionLength(s1: State, s2: State): number;
static FindLandings(s1: State, s2: State, shift: number): Position[];
static GetTransition(s: State, length: number, land_times: Position[]): Siteswap;
static ShortestTransition(s1: State, s2: State, allowFlipped: boolean, allowExtraFlipped?: boolean): Siteswap;
static BasicTransition(s1: State, s2: State): Siteswap;
static AllTransitionsOfLength(s1: State, s2: State, length: number): Generator<Siteswap, void, unknown>;
}