Skip to content

Room ​

Struct

Source: RoomGraph.h

Description ​

POD describing a single room: camera rect + optional tile window + fixed-size connection list.

A Room is always copyable and trivially constructible. All fields have sensible zero/default initializers so a default-constructed Room is safe to inspect (hasTileWindow == false, no connections).

Connections are stored by direction index (0 = Up, 1 = Down, 2 = Left, 3 = Right). An unused slot holds INVALID_ROOM (0xFFFF).

TIP

Connections are stored by direction index (0 = Up, 1 = Down, 2 = Left, 3 = Right). An unused slot holds INVALID_ROOM (0xFFFF).

Properties ​

NameTypeDescription
cameraMinXmath::ScalarLeft camera bound (world units)
cameraMinYmath::ScalarTop camera bound (world units)
cameraMaxXmath::ScalarRight camera bound (world units)
cameraMaxYmath::ScalarBottom camera bound (world units)
tileOriginColint16_tTile window origin column (-1 = unused)
tileOriginRowint16_tTile window origin row (-1 = unused)
tileColsint16_tTile window width in tiles
tileRowsint16_tTile window height in tiles
hasTileWindowboolTrue if tile window fields are valid
connections_intTarget room indices by direction (Up/Down/Left/Right)
connectionCount_uint8_tNumber of valid connections
constexprstaticSentinel for unused connection slots

Released under the MIT License.