Skip to the content

Gunjin軍人

Play five hidden-rank games, keep setups private, share redacted views and replay, and pass one device between players.

Gunjin is the Japanese word 軍人 for a soldier. About the name

Contents

Reference · Native shared-device player

mountGunjinfunction

Mounts a hotseat player. Only redacted views and replay data leave this handle.

Import it

import { mountGunjin } from "@johnmorrisdotca/gunjin/play";

Also exported from: @johnmorrisdotca/gunjin

Definition

function mountGunjin(host: HTMLElement, initial: AuthoritativeMatch, initialOptions?: MountOptions): GunjinMount

Parameters

NameTypeDescription
hostHTMLElement

The real HTMLElement that owns this independent native hotseat player.

initialAuthoritativeMatch

The initial authoritative match, kept inside the local hotseat player.

initialOptions (optional)MountOptions

Native language, material, piece style and redacted callbacks.

Returns

GunjinMount

The independent hotseat handle exposing redacted view/replay, presentation updates and cleanup.

Examples

import { createHasamiMatch } from "@johnmorrisdotca/gunjin/hasami";
import { mountGunjin } from "@johnmorrisdotca/gunjin/play";

const base=createHasamiMatch({width:7,height:7});
const host=document.createElement("div");
document.body.append(host);
const mounted=mountGunjin(host,base,{language:"ja"});
console.log(mounted.view().phase);
mounted.destroy();

View sourceEdit on GitHubMade from the source of @johnmorrisdotca/gunjin 0.2.1.