Data Types: The Snapshot Shapes
The plain Lua tables :info() copies out of a live object, field by field, grouped by the subsystem each comes from. A snapshot is a point-in-time copy for logging, serialising or diffing. It never updates. A field marked optional is absent (nil) when the data is not available or still resolving. Guard for it (snapshots vs handles).
local gob = hafen.session():current():player():gob()
local snapshot = gob:info() -- a plain table, frozen now
hafen.log():write(hafen.json():encode(snapshot)) -- what a live Gob cannot do
| Rule |
Detail |
| A catalogue, not a census |
Every object answers :info(). A shape one page reads (a timer, a keybinding, an option row) is stated in that page’s verb row. A shape lands here when more than one page names it, or when a table beats a sentence. |
| A snapshot keeps the client’s own spelling |
The verbs are camelCase (:modified(), :qualityInputs(), :questsDone()). A snapshot is the shape the client holds (isplayer, mtime, qmod). Each table names the verb beside the field where the two differ. |
The pages
| Page |
Holds |
| The client |
An addon the client discovered. |
| The session and the world |
One login and an object in it. The people beside you, and the ones a voice link relates you to. The ground, a place, your own things standing there. |
| The item and what holds it |
One item, and what a container states about its inside. |
| The character sheet |
Attributes, food with its FEP and hunger halves, learning, movement speed, quests, wounds, buffs. |
| The fight |
A manoeuvre, a card in the deck, the action-point budget, a saved school, an opponent, an opening, a combat action. |
| The map |
A pin on the recorded map, a minimap icon category. |
| The widget layer |
A widget in the tree. A HUD meter and one band of its bar. The open recipe. A hotbar slot. An action-menu entry. A chat channel and its lines. |
Every shape
See Also
- Conventions — why readers hand back an object instead.
- Shapes — the anonymous tables these fields carry: places, sizes, colours, units.
- Events — which of these shapes arrives as an event payload.
- The API reference — every namespace, and the live reads these copies come off.