リファレンス
さいころとカードの表示
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. |
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。