Skip to content

Class "RoomDescriptor"⚓︎

Modified Variables⚓︎

AllowedDoors⚓︎

DoorSet AllowedDoors⚓︎

Now properly returns a value.

Returns a bitmask corresponding to which door slots are currently enabled.

Doors are typically only included in this bitmask when there is a door currently present, even if the room would allow a door in that slot.

Example

This tests if the DoorSlot LEFT0 is enabled.

1
2
3
if roomDesc.AllowedDoors & (1 << DoorSlot.LEFT0) ~= 0 then
    print("Room has a door in slot LEFT0")
end


Functions⚓︎

AddRestrictedGridIndex ()⚓︎

void AddRestrictedGridIndex ( int GridIndex )⚓︎


GetDimension ()⚓︎

Dimension GetDimension ( )⚓︎

Returns the Dimension that this room exists in.


GetEntitiesSaveState ()⚓︎

EntitiesSaveStateVector GetEntitiesSaveState ( )⚓︎


GetGridEntitiesSaveState ()⚓︎

GridEntitiesSaveStateVector GetGridEntitiesSaveState ( )⚓︎


GetNeighboringRooms ()⚓︎

table GetNeighboringRooms ( )⚓︎

Returns a table that maps DoorSlot to RoomDescriptor for all of the current neighbors of this room.

Don't use ipairs to iterate over this, use pairs!

Example Code
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
-- Returns true if the room has a neighboring secret room.
local function HasSecretRoomNeighbor(roomDesc)
    for doorSlot, neighborDesc in pairs(roomDesc:GetNeighboringRooms()) do
        local roomType = neighborDesc.Data.Type
        if roomType == RoomType.ROOM_SECRET or roomType == RoomType.ROOM_SUPERSECRET or roomType == RoomType.ROOM_ULTRASECRET then
            return true
        end
    end
    return false
end

GetRestrictedGridIndexes ()⚓︎

int[] GetRestrictedGridIndexes ( )⚓︎


InitSeeds ()⚓︎

void InitSeeds ( RNG RNG )⚓︎


Variables⚓︎

BossDeathSeed⚓︎

int BossDeathSeed⚓︎


Doors⚓︎

int[] Doors⚓︎

Allows you to check which level grid index each DoorSlot in the room connects to.

For example, roomdesc.Doors[DoorSlot.UP0] provides the level grid index that the upwards door would connect to.

The value will be -1 if the RoomShape does not allow a door in that slot.

Note that this typically provides a valid index even if there is no door present, and even if the room itself does not allow a door in that slot.