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

tenkaMapModelfunction

EVERYTHING A DRAWING OF THE WORLD NEEDS, for one game: each territory's outline in its owner's colour, its counter's place and armies, and its ring. Shared by the plain-DOM table and the React map, so both draw the same world from the same few rules.

Import it

import { tenkaMapModel } from "@johnmorrisdotca/tenka/ui";

Definition

function tenkaMapModel(game: Pick<TenkaGame, "owners" | "armies" | "map">, marks?: TenkaMapMarks, colours?: readonly string[]): TenkaMapModel

Parameters

NameTypeDescription
gamePick<TenkaGame, "map" | "owners" | "armies">

The current native game state.

marks (optional)TenkaMapMarks

The chosen, reachable and target territory highlights.

colours (optional)readonly string[] | undefined

The seat colour palette.

Returns

TenkaMapModel

EVERYTHING A DRAWING OF THE WORLD NEEDS, for one game: each territory's outline in its owner's colour, its counter's place and armies, and its ring. Shared by the plain-DOM table and the React map, so both draw the same world from the same few rules.

Examples

import { startTenka } from "@johnmorrisdotca/tenka";
import { tenkaMapModel } from "@johnmorrisdotca/tenka/ui";

const game = startTenka(10,["Seat 1","Seat 2"],42)!;
console.log(tenkaMapModel(game).lands.length);
42

What it prints (run when this page was built)

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