本文へ移動

Tenka天下

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

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

目次

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

TenkaTableHandle型

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

Native game access, restoration, redealing and presentation updates.

インポート

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

定義

type TenkaTableHandle = {
    game: () => TenkaGame;
    newGame: (options?: Pick<TenkaTableOptions, "players" | "computers" | "rounds" | "seed" | "map">) => void;
    setGame: (game: TenkaGame, computers?: readonly boolean[]) => void;
    setLocale: (locale: TenkaLocale, strings?: Partial<TenkaStrings>) => void;
    set: (options: Pick<TenkaTableOptions, "locale" | "strings" | "theme" | "record" | "dressing" | "colours" | "computerDelayMs" | "onChange">) => void;
    destroy: () => void;
};

メンバー

名前型説明
game() => TenkaGame

The game as it stands.

newGame(options?: Pick<TenkaTableOptions, "players" | "computers" | "rounds" | "seed" | "map">) => void

A new game at the same table, with any options changed.

setGame(game: TenkaGame, computers?: readonly boolean[]) => void

Put a game on the table: one read back by tenkaFromJSON or decodeTenka. Seats keep who plays them when the number of players is the same; otherwise every seat but the first is the computer's, unless computers says.

setLocale(locale: TenkaLocale, strings?: Partial<TenkaStrings>) => void

Change the table's language, and with it any words of your own.

set(options: Pick<TenkaTableOptions, "locale" | "strings" | "theme" | "record" | "dressing" | "colours" | "computerDelayMs" | "onChange">) => void

Update presentation and callbacks without redealing or replacing the current game.

destroy() => void

Take the table off the page and stop its timers.

例

import type { TenkaTableHandle } from "@johnmorrisdotca/tenka/ui";
const update = (table: TenkaTableHandle) => table.set({ locale: "ja" });
console.log(typeof update);
function

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

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

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