Skip to main content

Module lyt

Module lyt 

Source
Expand description

LYT ASCII layout support. LYT ASCII reader and writer.

LYT (layout) resources describe room placement and optional track/obstacle props for a module.

§Shape of the file

Four count-led sections between beginlayout and donelayout: rooms, tracks, obstacles and doorhooks. Each declares its entry count and the entries follow as whitespace-separated fields. Doorhooks are the odd one, carrying a quaternion as well as a position.

This parser reads more loosely than the engine. The engine skips only the preamble before beginlayout, while this ignores any line it does not recognise as a known count section, wherever it sits. The tolerance runs one way. Output is canonical.

Text is decoded and encoded as Windows-1252. The grammar and the per-section field lists are in docs/src/formats/text/lyt.md, with the engine’s own parse sequence and its ordering requirement.

Structs§

Lyt
In-memory LYT layout.
LytDoorHook
One door-hook entry in a LYT layout.
LytObstacle
One obstacle entry in a LYT layout.
LytRoom
One room entry in a LYT layout.
LytTrack
One track entry in a LYT layout.
Quaternion
Quaternion value used by LYT door-hook orientation.
Vec3
Three-dimensional vector value used by LYT entries.

Enums§

LytError
Errors produced while parsing or serializing LYT ASCII data.

Functions§

read_lyt
Reads a LYT layout from a reader.
read_lyt_from_bytes
Reads a LYT layout from bytes.
write_lyt
Writes a LYT layout to a writer.
write_lyt_to_vec
Serializes a LYT layout to bytes.