3using System.Collections.Generic;
14 [Icon(ManiaMapResources.Icons.DoorNode2DIcon)]
20 private static Dictionary<Uid, LinkedList<DoorNode2D>>
ActiveRoomDoors {
get; } =
new Dictionary<Uid, LinkedList<DoorNode2D>>();
32 [ExportGroup(
"Door Code")]
38 public override void _Ready()
46 public override void _EnterTree()
50 if (!Engine.IsEditorHint())
54 public override void _ExitTree()
58 if (!Engine.IsEditorHint())
65 base.AutoAssign(room);
82 doors =
new LinkedList<DoorNode2D>();
103 if (doors.Count == 0)
116 if (doorConnection !=
null &&
ActiveRoomDoors.TryGetValue(roomId, out var doors))
118 foreach (var door
in doors)
120 if (door.DoorConnection == doorConnection)
The base class for elements tied to a RoomNode2D's cell index.
RoomNode2D Room
The contained room.
A possible door location connecting two RoomNode2D.
void AddToActiveRoomDoors()
Adds the door to the active room doors dictionary.
DoorConnection DoorConnection
override void AutoAssign(RoomNode2D room)
Assigns the room and any auto assigned values to the object.
void RemoveFromActiveRoomDoors()
Removes the door from the active room doors dictionary.
DoorDirection DoorDirection
static DoorNode2D FindActiveDoor(Uid roomId, DoorConnection doorConnection)
Returns the door in the scene with the matching room ID and door connection.
static Dictionary< Uid, LinkedList< DoorNode2D > > ActiveRoomDoors
A dictionary of doors in the scene by room ID.
const string DoorCodeFlags
The door code enum string.
Contains resource references for the project.
A node serving as the top level of a 2D room.
DoorDirection FindClosestDoorDirection(int row, int column, Vector2 position)
Returns the closest door direction based on the cell index and specified global position....
A possible door location connecting two IRoomNode.