Reference · Cube engine and views
CubeOptiontype
One choice.
Import it
import type { CubeOption } from "@johnmorrisdotca/kyuubu";
Definition
type CubeOption = {
id: string;
group: OptionGroup;
kind: OptionKind;
default?: string | number | boolean;
choices?: readonly string[];
choiceLabels?: Readonly<Record<string, Readonly<Record<string, string>>>>;
range?: {
min: number;
max: number;
step: number;
};
names: {
view?: string;
player?: string;
cube?: string;
turning?: string;
cuboid?: string;
cuboidPlayer?: string;
cuboidElement?: string;
};
factor?: {
player?: number;
};
say: Record<KyuubuLanguage, {
label: string;
help: string;
}>;
};
Members
| Name | Type | Description |
|---|---|---|
id | string | Its one name, in kebab case: what the builder's controls and its address call it. |
group | OptionGroup | |
kind | OptionKind | |
default (optional) | string | number | boolean | undefined | What it is when nothing is said: the same as leaving it out. Absent where leaving it out is its own state (no theme, no scale). |
choices (optional) | readonly string[] | undefined | The ways to choose from, for a |
choiceLabels (optional) | Readonly<Record<string, Readonly<Record<string, string>>>> | undefined | The words for each choice, by language; the value itself is what is written in code. |
range (optional) | { min: number; max: number; step: number; } | undefined | The least, the most and the step, for a |
names | { view?: string; player?: string; cube?: string; turning?: string; cuboid?: string; cuboidPlayer?: string; cuboidElement?: string; } | What each way of making a cube calls it: |
factor (optional) | { player?: number; } | undefined | What the player's option is worth in this option's own unit: |
say | Record<KyuubuLanguage, { label: string; help: string; }> | The label and the one plain line, in each language. |
Examples
import type { CubeOption } from "@johnmorrisdotca/kyuubu";
import { CUBE_OPTIONS } from "@johnmorrisdotca/kyuubu";
const value: CubeOption = CUBE_OPTIONS[0]!;
console.log(value.id);sizeWhat it prints (run when this page was built)