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
| Name | Type | Description |
|---|---|---|
host | HTMLElement | The real HTMLElement that owns this independent native hotseat player. |
initial | AuthoritativeMatch | 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();