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 · Browser table and SVG

TenkaDressingtype

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. A dressing only ever draws. The numbers on the dice, the cards in a hand and the cards left in the deck are the game's, already decided, and a dressing that tumbles a die lands it on the face the game threw, so a game replays move for move whatever it is dressed in. Anything left out is drawn the plain way. tenkaDressing from @johnmorrisdotca/tenka/dressing makes one out of Korokoro's dice and Toranpu's cards.

Import it

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

Also exported from: @johnmorrisdotca/tenka/dressing

Definition

type TenkaDressing = {
    die?: (face: number, how: TenkaDieHow) => TenkaDrawn;
    card?: (how: TenkaCardHow) => TenkaDrawn;
    back?: (how: TenkaBackHow) => TenkaDrawn;
};

Members

NameTypeDescription
die (optional)((face: number, how: TenkaDieHow) => TenkaDrawn) | undefined

One die of the last throw, showing face (1 to 6).

card (optional)((how: TenkaCardHow) => TenkaDrawn) | undefined

One card of the hand on the table.

back (optional)((how: TenkaBackHow) => TenkaDrawn) | undefined

The back of a card: the deck, drawn beside the hand with the number left in it. Nothing is drawn if this is left out.

Examples

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

const value: TenkaDressing = {back:()=>({element:document.createElement("span")})};
console.log(value);

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