Reference · Cube engine and views
ReplayCubetype
The part of a cube's view a replay needs: CubeView is one.
Import it
import type { ReplayCube } from "@johnmorrisdotca/kyuubu";
Definition
type ReplayCube = {
setState(state: string, size?: number): void;
turnTogether(moves: readonly CubeMove[], options?: {
animate?: boolean;
ms?: number;
}): void;
readonly busy?: boolean;
};
Members
| Name | Type | Description |
|---|---|---|
setState | (state: string, size?: number): void | |
turnTogether | (moves: readonly CubeMove[], options?: { animate?: boolean; ms?: number; }): void | |
busy (optional) | boolean | undefined | Whether a turn asked for is still on its way; a cube that does not say is taken to be at rest. |
Examples
import type { ReplayCube } from "@johnmorrisdotca/kyuubu";
import { movesNotation } from "@johnmorrisdotca/kyuubu";
const value: ReplayCube = { setState: (state) => console.log(state), turnTogether: (moves) => console.log(movesNotation(moves, 3)) };
console.log(typeof value.turnTogether);functionWhat it prints (run when this page was built)