Reference
Views, replay and player
import { … } from "@johnmorrisdotca/gunjin";
12.9 kB minified and gzipped, with everything it imports (measured with esbuild)
SVG board rendering and its optional visual settings.
Exports
| Name | Kind | What it is |
|---|---|---|
boardFeatures | function | Public board markings (camps, headquarters and lakes), with no role-dependent information. |
Coordinate | type | Zero-based board location shared by engine actions and public views. |
decodePublicReplay | function | Validates a role-free replay record for display; it cannot resume a match. |
drawGunjinBoard | function | Draws only a redacted player view. |
DrawOptions | type | Visual settings and temporary selection marks for the role-redacted SVG renderer. |
encodePublicReplay | function | Serializes the role-redacted public replay record as JSON. |
GameMode | type | Selects one of the five rule modules supported by this package. |
GUNJIN_STYLE | constant | Scoped presentation styles applied by the hotseat mount. |
GunjinMount | type | Public controls returned by mountGunjin; no authoritative state is exposed. |
Language | type | Supported interface locales. |
legalMovesForCurrentPlayer | function | Legal move coordinates for the player whose turn it is; roles are never returned. |
MatchResult | type | Public outcome recorded when a match ends. |
Material | type | Board palettes shared with the game family. |
modeName | function | Returns the localized display name for a ruleset. |
mountGunjin | function | Mounts a hotseat player. |
MountOptions | type | Locale, materials, and safe public callbacks for a mounted hotseat player. |
MoveAction | type | Move requests are public, deterministic and rejected if their turn is stale. |
PieceStyle | type | Available piece silhouettes. |
Player | type | The player whose private side is red. |
playerName | function | Returns the localized name for one side. |
PlayerView | type | Information safe to render for one player at the current pass boundary. |
publicPosition | function | Redacted position for spectators: only player ownership and occupied cells are returned. |
PublicPosition | type | Role-free current position suitable for observers and change callbacks. |
publicReplay | function | Creates a public replay with only combat ranks that the selected rules expose. |
PublicReplay | type | A shareable record without private setups or piece IDs; only mode-published combat ranks may appear. |
roleName | function | Returns a localized piece label, with a readable fallback for unknown roles. |
STRINGS | constant | English and Japanese interface labels used by the renderer and player. |
ViewedPiece | type | Player-facing piece. |
viewForPlayer | function | A player view redacts opponent roles and suppresses the board during device handoff. |
words | function | Returns the localized interface string table. |