5using System.Collections.Generic;
32 private Dictionary<Uid, List<DoorConnection>>
RoomConnections {
get; } =
new Dictionary<Uid, List<DoorConnection>>();
37 private Dictionary<int, List<Room>>
RoomsByLayer {
get; } =
new Dictionary<int, List<Room>>();
42 private Dictionary<Uid, List<DoorPosition>>
RoomDoors {
get; } =
new Dictionary<Uid, List<DoorPosition>>();
66 ArgumentNullException.ThrowIfNull(layout, nameof(layout));
67 ArgumentNullException.ThrowIfNull(state, nameof(state));
69 if (layout.Id != state.Id)
70 throw new ArgumentException($
"Layout and layout state ID's do not match: (Layout ID = {layout.Id}, Layout State ID = {state.Id})");
89 return Array.Empty<DoorConnection>();
101 return Array.Empty<Room>();
111 if (
RoomDoors.TryGetValue(
id, out var doors))
113 return Array.Empty<DoorPosition>();
122 public bool DoorExists(Uid
id, Vector2DInt position, DoorDirection direction)
126 if (door.Matches(position, direction))
153 if (connection.ContainsDoor(
id, position, direction))
Holds the current Layout and LayoutState.
Dictionary< int, List< Room > > RoomsByLayer
A dictionary of rooms by layer coordinate.
LayoutState LayoutState
The layout state.
LayoutPack(Layout layout, LayoutState state, string settingsPath)
Initializes a new layout pack.
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 settings.
LayoutPack(Layout layout, LayoutState state, ManiaMapSettings settings=null)
Initializes a new layout pack.
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 various runtime settings.