Expand description
Every slot and record width of the view’s frame and structural snapshot,
by name. Decode both with these, such as frame[header::MONEY], never
with bare numbers. super::layout_json hands the same tables over as
JSON, with the state, weather, mode and calendar codes, for a host in
another language.
Modules§
- car
- The slots of one car, counted from the car’s start.
- header
- The dynamic frame’s header slots, one name each.
UNLOCKEDholds the unlocked kinds as a bitmask by kind code in one double, with more than 32 bits in use: read bit k asMath.floor(mask / 2 ** k) % 2, since JavaScript’s bitwise operators cut a number to 32 bits.FRAME_SEQcounts the reader’s frames from 1: a host that sees it skip a number missed a frame, and asks for a full one before it applies another.DAYthroughWEEKEND_DAYSare the clock’s readings on the tower’s calendar (the day count, the day of the week, the weekend flag as 0 or 1, the quarter and the year, all counted from 0) and the calendar’s week and weekend lengths in days, so a host shows dates without doing the date arithmetic.BOMB_SEARCH_SEQis 0 while no bomb search runs and otherwise moves with every change to it, so a host rereads the search only when it moved. - person
- The slots of a drawn person’s record.
- room
- The slots of a room in the structural snapshot.
- run
- The slots of a run of floor or lobby tiles:
COUNTtiles of one kind and width side by side on one floor, the k-th atX + k * WIDTH, every one with the same frame fields. - shaft
- The slots of a transport in the structural snapshot, before its
SKIPSskipped floors. - structure
- The structural snapshot’s header slots.
HIGHEST_FLOORandLOWEST_FLOORare the highest and lowest floor any unit stands on (1 on an empty tower), the bounds the camera reads;MODEandCALENDARare the game mode and the Modern calendar, by the codes inMODESandCALENDARS;SCENE_SEEDis the founding seed the scenery derives from (so the scenery stays the same across saves), fixed for a tower’s life. - transport
- The slots of a transport’s record in the dynamic frame:
IDandCARS, thenCARScar records. - unit
- The slots of a changed room’s record: its slot in the structural snapshot’s room list, then its frame fields.
Constants§
- CAR_
RECORD - Slots of each car.
- HEADER
- Slots of the dynamic frame’s header.
- PERSON_
RECORD - Slots of a person record.
- ROOM_
RECORD - Slots of a room record in the structural snapshot.
- RUN_
RECORD - Slots of a run record.
- SHAFT_
FIXED - Slots of a shaft record before its skipped floors.
- STRUCTURE_
HEADER - Slots of the structural snapshot’s header.
- TRANSPORT_
FIXED - Slots of a transport record before its cars.
- UNIT_
RECORD - Slots of a room record in the dynamic frame.
- VIEW_
LAYOUT_ VERSION - The version of the view’s layout. It goes up when a slot moves, a width changes, or a slot or code changes meaning.
Functions§
- layout_
json - The layout as a value: the version, every table’s slots and width, the
codes (kinds, unit and person states, weather, modes, calendars) and the
metadata record’s fields. A kind’s code is its index in
kinds(the catalog’s order,Kind as usize), andnamesholds each kind’s catalog name, which is a unit’s label when a full metadata listing leaves the unit out.