Skip to content

Class "LevelGeneratorRoom"⚓︎

Info

This class is used during level generation. Its purpose is to represent a slot in the graph of rooms that is generated during the generation phase.

This class is immutable and cannot be instanciated manually: you cannot change the value of the fields of an instance and you cannot instance it by yourself.

Access to instances is always performed through methods of the LevelGenerator itself, or instances are given as parameters of the callbacks:

Functions⚓︎

Column ()⚓︎

int Column ( )⚓︎

Return the column of the room slot on the level grid (index is 0 based).


DoorMask ()⚓︎

int DoorMask ( )⚓︎

Return a mask of the available doors of the room slot. In order to check if a door at a given slot is available, use the DoorSlot enumeration.

Example

This tests if the DoorSlot LEFT0 is available.

1
2
3
if room:DoorMask() & (1 << DoorSlot.LEFT0) then
    print ("Room has a door on slot LEFT0)
end


GenerationIndex ()⚓︎

int GenerationIndex ( )⚓︎

Index of the room during generation: 0 if the room was the first to be generated, 1 if it was the second etc.


IsDeadEnd ()⚓︎

boolean IsDeadEnd ( )⚓︎


Neighbors ()⚓︎

int[] Neighbors ( )⚓︎

Returns a table of the generation indices of the neighboring rooms.


Row ()⚓︎

int Row ( )⚓︎

Return the row of the room slot on the level grid (index is 0 based).


Shape ()⚓︎

int Shape ( )⚓︎

Return the shape of the room, as per the RoomShape enumeration.