本文へ移動

Tenka天下

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

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

目次

リファレンス

さいころとカードの表示

import { … } from "@johnmorrisdotca/tenka/dressing";

最小化と gzip 圧縮をしたサイズは 136.1 kB(読み込むものをすべて含み、esbuild で計測)

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

Tenka's table dressed in the family's dice and cards: Korokoro's dice for the dice of every attack, tumbling onto the faces the game threw, and Toranpu's cards for the cards in a hand, with a territory card of Tenka's own and a back of Tenka's own for the deck.

This is its own entry because it is the one place Tenka reaches for another package. @johnmorrisdotca/korokoro and @johnmorrisdotca/toranpu are optional peer dependencies of it and of nothing else: the rules, the map, the computer player and the plain table (/ui, /react, /element) need neither, and a page that never imports this file never loads them. It only draws. The dice are thrown by the game's own seeded random, as they always were, and Korokoro is handed the face that came up; the cards are the game's hands. A game plays and replays the same whether or not it is dressed.

import { mountTenka } from "@johnmorrisdotca/tenka/ui";
import { tenkaDressing } from "@johnmorrisdotca/tenka/dressing";

mountTenka(document.getElementById("table")!, { dressing: tenkaDressing() });

エクスポート

名前種類概要
TENKA_BACK定数Tenka's own back, as the deck shows it.
TenkaBackHow型What a dressing is told about the back it is asked to draw.
tenkaCardDesign関数Tenka's cards as a Toranpu design: ask Toranpu for tenkaCardId(map, territory) in this design and it draws the territory's shape and name with its army's symbol, on its paper and in its frame.
TenkaCardHow型What a dressing is told about a card it is asked to draw.
tenkaCardId関数The id of a card in Toranpu's hands: tenka-world-12 for the world's twelfth territory, tenka-wild for a wild card.
tenkaCardOfId関数The map and territory an id of tenkaCardId names, or null for a wild card (wild: true) or anything else.
TenkaDieHow型What a dressing is told about a die it is asked to draw.
TenkaDrawn型Something a dressing drew: the element to put on the table, and what to do when the table takes it away again (stop a timer, say).
tenkaDressing関数Tenka's dice and cards, drawn by the packages that draw them best: give the result to mountTenka, to the React TenkaTable, or to a <tenka-table>'s dressing.
TenkaDressing型HOW A TABLE DRAWS ITS DICE AND ITS CARDS, if not the plain way: each is a function that is given what the rules decided and hands back the element to show.
TenkaDressingOptions型What tenkaDressing may be given.
tenkaThrownDie関数A random source for Korokoro that comes up with face on a die of six: how a die is made to tumble onto the face the game has already thrown.

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

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