本文へ移動

Tenka天下

2〜6人で、シードから始まる世界征服ゲームを遊べます。さいころでの戦い、カード、コンピューターの相手、ゲームの保存に対応します。

「天下」は、天の下に広がる世界を表す言葉です。 名前について(英語)

目次

リファレンス · ブラウザーの卓とSVG

TenkaTableOptions型

リファレンスの説明と例は英語です。見出しと目次は日本語です。

Native table settings; defaults to three players, with two computers.

インポート

import type { TenkaTableOptions } from "@johnmorrisdotca/tenka/ui";

定義

type TenkaTableOptions = {
    players?: readonly string[];
    computers?: readonly boolean[];
    rounds?: number;
    seed?: number;
    map?: TenkaMapKey;
    colours?: readonly string[];
    computerDelayMs?: number;
    onChange?: (game: TenkaGame) => void;
    locale?: TenkaLocale;
    strings?: Partial<TenkaStrings>;
    theme?: Readonly<Record<string, string>>;
    record?: boolean;
    dressing?: TenkaDressing;
};

メンバー

名前型説明
players (省略可)readonly string[] | undefined

The names round the table, in seat order: two to six.

computers (省略可)readonly boolean[] | undefined

Which seats the computer plays. By default every seat but the first.

rounds (省略可)number | undefined

Rounds before the count: 10, 20, or 60 for the whole world.

seed (省略可)number | undefined

The seed every deal and die is drawn from; a new one each game when absent.

map (省略可)TenkaMapKey | undefined

The map: "world" (the default) or "europe".

colours (省略可)readonly string[] | undefined

A colour for each seat.

computerDelayMs (省略可)number | undefined

How long the computer waits before each of its moves, in milliseconds.

onChange (省略可)((game: TenkaGame) => void) | undefined

Told of every game after a move.

locale (省略可)TenkaLocale | undefined

The language of the table: "en" or "ja". By default the page's own (<html lang>), and English for any other.

strings (省略可)Partial<TenkaStrings> | undefined

Words of your own, laid over the locale's: any of TenkaStrings.

theme (省略可)Readonly<Record<string, string>> | undefined

CSS variables set on the table itself, which win in light and dark alike: { "--tk-sea": "#23405a" }.

record (省略可)boolean | undefined

Whether the table shows the record of the game, with saving and loading. True by default.

dressing (省略可)TenkaDressing | undefined

How the dice and the cards are drawn, if not the plain way: tenkaDressing() from @johnmorrisdotca/tenka/dressing draws them with Korokoro's dice and Toranpu's cards. The game is the same either way.

例

import type { TenkaTableOptions } from "@johnmorrisdotca/tenka/ui";
const options: TenkaTableOptions = { seed: 7, record: false };
console.log(options.seed);
7

出力(このページを作ったときに実行した結果)

ソースを見るGitHub で編集@johnmorrisdotca/tenka 2.2.0 のソースから作成しました。

この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。