# gizgame/realm

An online world as data: a world file's "realm" names who lives where, what they know, the quests, the round and the HUD, by the spots of the map. The engine makes the Online of it (gizgame/online); a game's program holds no world.

```gizlang
import * as Realm from "gizgame/realm";
```

## Types

### `Stand`

```gizlang
type Stand = { kind: string; spot: string; count?: i64; roams?: bool; from?: i64; }
```

COUNT beings (1) of KIND at the points of spot SPOT, in order FROM its first (0). One that ROAMS rises at another point after each
fall.

- `kind`: `string`
- `spot`: `string`
- `count`: `_gizlang_sdk_core.Option<i64>`
- `roams`: `_gizlang_sdk_core.Option<bool>`
- `from`: `_gizlang_sdk_core.Option<i64>`

### `Joined`

```gizlang
type Joined = { kinds: Vec<string>; spot: string; roams?: bool; }
```

The players: of KINDS in turn, at the points of SPOT; ROAMS as a Stand's.

- `kinds`: `Vec<string>`
- `spot`: `string`
- `roams`: `_gizlang_sdk_core.Option<bool>`

### `Lore`

```gizlang
type Lore = { id: string; kind: string; about: string; spot?: string; kept?: bool; }
```

A fact a quest may name (Procgen.Fact), at spot SPOT for a person or a place. KEPT: no bounty names it.

- `id`: `string`
- `kind`: `string`
- `about`: `string`
- `spot`: `_gizlang_sdk_core.Option<string>`
- `kept`: `_gizlang_sdk_core.Option<bool>`

### `Site`

```gizlang
type Site = { name: string; spot?: string; }
```

A place the minds know as NAME: the spot SPOT (its name unless given).

- `name`: `string`
- `spot`: `_gizlang_sdk_core.Option<string>`

### `World`

```gizlang
type World = { heroes: Joined; crew?: Vec<Stand>; folk?: Vec<Stand>; minds?: Minds; places?: Vec<Site>; quests?: Vec<Procgen.Quest>; facts?: Vec<Lore>; bounties?: i64; hud?: Vec<string>; words?: Words; shots?: Shots3D; goal?: string; popups?: bool; maps?: Vec<string>; reach?: f64; edge?: f64; talk?: f64; party?: f64; wear?: Vec<string>; sky?: Vec<f64>; items?: Vec<Item>; round?: Round; chat?: Chat; keys?: Keys; }
```

An online world (gizgame/online Realm) as data. HEROES join; the CREW (the seats the server drives) and the FOLK
live in it from the start, each at its spot. MINDS are the personas, with the PLACES they know. QUESTS are checked
against the FACTS, and BOUNTIES more are made of the facts. HUD names the widgets over it ("adventure" unless given:
adventure, crosshair, arsenal, vitals, tally, roundClock, chat, questLog, compass, beacon, bars, bubbles), saying
WORDS; a map's rules add their own. SHOTS draws the guns' shots, GOAL is the thing that marks a quest's place, and
POPUPS (true unless said) show the health a being loses. MAPS names the maps it lives on (every map unless given).
The rest is the Realm's; its ticks are the game's.

- `heroes`: `M245.Joined`
- `crew`: `_gizlang_sdk_core.Option<Vec<M245.Stand>>`
- `folk`: `_gizlang_sdk_core.Option<Vec<M245.Stand>>`
- `minds`: `_gizlang_sdk_core.Option<M232.Minds>`
- `places`: `_gizlang_sdk_core.Option<Vec<M245.Site>>`
- `quests`: `_gizlang_sdk_core.Option<Vec<M243.Quest>>`
- `facts`: `_gizlang_sdk_core.Option<Vec<M245.Lore>>`
- `bounties`: `_gizlang_sdk_core.Option<i64>`
- `hud`: `_gizlang_sdk_core.Option<Vec<string>>`
- `words`: `_gizlang_sdk_core.Option<M265.Words>`
- `shots`: `_gizlang_sdk_core.Option<M253.Shots3D>`
- `goal`: `_gizlang_sdk_core.Option<string>`
- `popups`: `_gizlang_sdk_core.Option<bool>`
- `maps`: `_gizlang_sdk_core.Option<Vec<string>>`
- `reach`: `_gizlang_sdk_core.Option<f64>`
- `edge`: `_gizlang_sdk_core.Option<f64>`
- `talk`: `_gizlang_sdk_core.Option<f64>`
- `party`: `_gizlang_sdk_core.Option<f64>`
- `wear`: `_gizlang_sdk_core.Option<Vec<string>>`
- `sky`: `_gizlang_sdk_core.Option<Vec<f64>>`
- `items`: `_gizlang_sdk_core.Option<Vec<M236.Item>>`
- `round`: `_gizlang_sdk_core.Option<M236.Round>`
- `chat`: `_gizlang_sdk_core.Option<M235.Chat>`
- `keys`: `_gizlang_sdk_core.Option<M236.Keys>`

### `Fields`

```gizlang
type Fields = { rules?: Rules.Rules; realm?: World; }
```

What a world's files hold beside the maps: the rules (gizgame/rules) and the realm.

- `rules`: `_gizlang_sdk_core.Option<M246.Rules>`
- `realm`: `_gizlang_sdk_core.Option<M245.World>`

### `Realms`

```gizlang
type Realms = { scene: (map: i64, data: Map3D) => Scene3D throws string; carry: (input: bytes) => bytes; online: () => Online throws string; }
```

A game's online world, made of its files once they are here: SCENE is what play3D draws of a map (the map's file,
its rules, and the realm on its maps), CARRY what play3D carries between maps, and ONLINE the world itself (its
`local` is the world of a window alone).

- `scene`: `(arg0: i64, arg1: M229.Map3D) => M248.Scene3D throws string`
- `carry`: `(arg0: bytes) => bytes`
- `online`: `() => Ref<M236.Online> throws string`

## Functions

### `realms`

```gizlang
function realms(game: Game): Realms
```

GAME's online world of its world file's realm (Fields; Game.world takes Json.schema<Realms.Fields>).

Effects: fail, read, write, console, io, alloc.

### `seats`

```gizlang
function seats(game: Game, r: Realms): Seats
```

The seats of GAME's world R for a served room. A host takes them before it gives the files (supply), so the world is
made at the first use after. A function of its own: a game as WebAssembly calls it nowhere and holds no server.

Effects: fail, write, alloc.

### `local`

```gizlang
function local(game: Game, r: Realms): void throws string
```

GAME's world R for a window alone (a host's `local`).

Effects: fail, read, write, console, io, alloc.

