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
| Name | Type | Description |
|---|---|---|
die (optional) | ((face: number, how: TenkaDieHow) => TenkaDrawn) | undefined | One die of the last throw, showing |
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);