3using System.Collections.Generic;
16 private static Dictionary<Uid, LinkedList<DoorComponent>>
ActiveDoorsByRoom {
get; } =
new Dictionary<Uid, LinkedList<DoorComponent>>();
20 private bool _autoAssignDirection =
true;
28 private DoorDirection _direction;
32 public DoorDirection
Direction {
get => _direction;
set => _direction = value; }
35 private DoorType _type;
39 public DoorType
Type {
get => _type;
set => _type = value; }
42 private DoorCode _code;
46 public DoorCode
Code {
get => _code;
set => _code = value; }
67 return new Uid(-1, -1, -1);
72 protected override void OnDestroy()
100 foreach (var door
in doors)
102 if (door.Connection == connection)
119 doors =
new LinkedList<DoorComponent>();
142 var position =
new Vector2DInt(
Row,
Column);
151 base.AutoAssign(room);
An object tied to the cell index of a RoomComponent.
UnityEvent OnInitialize
The event invoked after the object is initialized.
RoomComponent Room
The containing room.
int Column
The column index.
bool IsInitialized
True if the object has been initialized.
A component representing a possible door location.
bool DoorExists()
True if the door exists in the layout.
Uid ToRoomId()
The room ID of the room this door connects to.
bool AutoAssignDirection
If true, the door direction will be automatically assigned to the cell when update and save operation...
Door GetMMDoor()
Returns the Mania Map door used by the procedural generator.
DoorConnection FindDoorConnection()
Returns the door connection in the layout associated with the door. Returns null if the door connecti...
void RemoveFromActiveDoors()
Removes the door from the doors dictionary.
DoorCode Code
The door code.
static DoorComponent FindDoor(Uid roomId, DoorConnection connection)
Finds the door with the specified room ID and door connection. Returns null if the door is not found.
override void AutoAssign(RoomComponent room)
Auto assigns elements to the door.
DoorType Type
The door type.
DoorConnection Connection
The associated door connection in the layout.
DoorDirection Direction
The door direction.
override void Initialize()
Initializes the object.
void AddToActiveDoors()
Adds the door to the doors dictionary.
static Dictionary< Uid, LinkedList< DoorComponent > > ActiveDoorsByRoom
A dictionary of door components in the scene by their room ID.
DoorConnection FindDoorConnection(Uid id, Vector2DInt position, DoorDirection direction)
Returns the door connection with the given room ID, position, and direction if it exists....
A component for creating a room.
Room RoomLayout
The room data.
LayoutPack LayoutPack
The layout pack.
DoorDirection FindClosestDoorDirection(int row, int column, Vector3 position)
Returns the closest door direction based on the specified global position.
bool IsInitialized
True if the room has been initialized.