Skip to the content

Tenka天下

Play seeded world conquest for two to six, with dice battles, cards, computer players and saved games.

Tenka means the world under heaven in Japanese. About the name

Contents

Reference

Dice and card dressing

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

136.1 kB minified and gzipped, with everything it imports (measured with 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() });

Exports

NameKindWhat it is
TENKA_BACKconstantTenka's own back, as the deck shows it.
TenkaBackHowtypeWhat a dressing is told about the back it is asked to draw.
tenkaCardDesignfunctionTenka'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.
TenkaCardHowtypeWhat a dressing is told about a card it is asked to draw.
tenkaCardIdfunctionThe id of a card in Toranpu's hands: tenka-world-12 for the world's twelfth territory, tenka-wild for a wild card.
tenkaCardOfIdfunctionThe map and territory an id of tenkaCardId names, or null for a wild card (wild: true) or anything else.
TenkaDieHowtypeWhat a dressing is told about a die it is asked to draw.
TenkaDrawntypeSomething 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).
tenkaDressingfunctionTenka'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.
TenkaDressingtypeHOW 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.
TenkaDressingOptionstypeWhat tenkaDressing may be given.
tenkaThrownDiefunctionA 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.

View sourceEdit on GitHubMade from the source of @johnmorrisdotca/tenka 2.2.0.