dao::world::Room

struct

A room of the current area.

Areas are divided into rooms, and a room the party has never seen is drawn black, along with everything in it.

Whether a room has been seen depends on the party, not the camera: the rooms the party stands in, and some of their neighbours, are in view, and a room stays seen once it has been in view. Whether a room is loaded depends on the camera. An outdoor area’s rooms are cells of its terrain and never read as loaded, so use Shown() to decide whether a room is drawn.

if (const auto room = dao::world::RoomOf(enemy); room && !room->Shown())
    ; // don't send the camera there: the player would see only black

Declared in dao/World.h.

Functions

Loaded()

bool Loaded() const

Returns true if the room is loaded.

Only meaningful indoors: an outdoor area’s rooms never read as loaded, even the one under the party’s feet.

Shown()

bool Shown() const

Returns true if the party sees the room now or has seen it before, so the game draws it and everything in it instead of black.

Fields

Field Type  
distance float = 0 How far the point asked about lies outside the room’s bounds, in metres; 0 inside them. Set by RoomAt and RoomOf, otherwise 0.
kDropped std::int32_t = 3 not wanted, so unloaded
kInView std::int32_t = 1 the party is in it or in a room that sees it
kLoaded std::int32_t = 1  
kLoading std::int32_t = 0  
kNeverSeen std::int32_t = 0 hidden, so drawn black
kNotLoaded std::int32_t = 2  
kSeenBefore std::int32_t = 2  
kWanted std::int32_t = 4 kept, and loaded in the background if not yet
kWantedNow std::int32_t = 5 loaded at once, ahead of the others
load std::int32_t = kNotLoaded kLoading, kLoaded or kNotLoaded
loading bool = false true while a background load is under way
number std::int32_t = 0 the room’s number, as in its file name, <area>_<number>.rim
seen std::int32_t = kNeverSeen kNeverSeen, kInView or kSeenBefore
state std::int32_t = 0 How much the game last wanted the room: kDropped, kWanted or kWantedNow indoors; 6 for a terrain cell outdoors.