3using System.Collections.Generic;
31 private Dictionary<Uid, List<DoorConnection>>
RoomConnections {
get; } =
new Dictionary<Uid, List<DoorConnection>>();
36 private Dictionary<int, List<Room>>
RoomsByLayer {
get; } =
new Dictionary<int, List<Room>>();
41 private Dictionary<Uid, List<DoorPosition>>
RoomDoors {
get; } =
new Dictionary<Uid, List<DoorPosition>>();
58 throw new System.ArgumentException(
"Layout cannot be null.");
59 if (layoutState ==
null)
60 throw new System.ArgumentException(
"Layout state cannot be null.");
61 if (layout.Id != layoutState.Id)
62 throw new System.ArgumentException($
"Layout and layout state ID's do not match: (Layout ID = {layout.Id}, Layout State ID = {layoutState.Id})");
82 return System.Array.Empty<DoorConnection>();
94 return System.Array.Empty<Room>();
104 if (
RoomDoors.TryGetValue(
id, out var doors))
106 return System.Array.Empty<DoorPosition>();
115 public bool DoorExists(Uid
id, Vector2DInt position, DoorDirection direction)
119 if (door.Matches(position, direction))
146 if (connection.ContainsDoor(
id, position, direction))
A manager for maintaining the current map data and state.
Dictionary< int, List< Room > > RoomsByLayer
A dictionary of rooms by layer coordinate.
LayoutPack(Layout layout, LayoutState layoutState, ManiaMapSettings settings=null)
Initializes a new object.
LayoutState LayoutState
The layout state.
RectangleInt LayoutBounds
The bounds of the layout.
DoorConnection FindDoorConnection(Uid id, Vector2DInt position, DoorDirection direction)
Returns the door connection with the given room ID, position, and direction if it exists....
IReadOnlyList< DoorPosition > GetRoomDoors(Uid id)
Returns a list of door positions for the specified room ID. If the room ID does not exist,...
Dictionary< Uid, List< DoorConnection > > RoomConnections
A dictionary of door connections by room ID.
IReadOnlyList< DoorConnection > GetDoorConnections(Uid id)
Returns a list of door connections with a room for the specified room ID. If the room ID does not exi...
IReadOnlyList< Room > GetRoomsInLayer(int z)
Returns a list of rooms corresponding to the specified layer (z) coordinate. If the layer does not ex...
bool DoorExists(Uid id, Vector2DInt position, DoorDirection direction)
Returns true if the door exists for the specified cell index and direction.
ManiaMapSettings Settings
The applied settings.
IEnumerable< int > GetLayerCoordinates()
Returns an enumerable of unique layer (z) coordinates for the layout. The coordinates are not in any ...
Dictionary< Uid, List< DoorPosition > > RoomDoors
A dictionary of door positions by room ID.
Contains settings used by Mania Map components.