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

GunjinMounttype

Public controls returned by mountGunjin; no authoritative state is exposed.

Import it

import type { GunjinMount } from "@johnmorrisdotca/gunjin/play";

Also exported from: @johnmorrisdotca/gunjin

Definition

type GunjinMount = {
    view: () => ReturnType<typeof viewForPlayer>;
    replay: () => string;
    set: (options: MountOptions) => void;
    destroy: () => void;
};

Members

NameTypeDescription
view() => ReturnType<typeof viewForPlayer>
replay() => string
set(options: MountOptions) => void
destroy() => void

Examples

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

const base=createHasamiMatch({width:7,height:7});
const host=document.createElement("div");
document.body.append(host);
const mounted: GunjinMount=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.