![]() |
ManiaMap.Unity
Procedural generation of metroidvania style maps for Unity.
|
A manager for maintaining the current map data and state. More...
Public Member Functions | |
bool | DoorExists (Uid id, Vector2DInt position, DoorDirection direction) |
Returns true if the door exists for the specified cell index and direction. More... | |
DoorConnection | FindDoorConnection (Uid id, Vector2DInt position, DoorDirection direction) |
Returns the door connection with the given room ID, position, and direction if it exists. Returns null if the connection does not exist. More... | |
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 exist, returns an empty list. More... | |
IEnumerable< int > | GetLayerCoordinates () |
Returns an enumerable of unique layer (z) coordinates for the layout. The coordinates are not in any particular order. More... | |
IReadOnlyList< DoorPosition > | GetRoomDoors (Uid id) |
Returns a list of door positions for the specified room ID. If the room ID does not exist, returns an empty list. More... | |
IReadOnlyList< Room > | GetRoomsInLayer (int z) |
Returns a list of rooms corresponding to the specified layer (z) coordinate. If the layer does not exist, returns an empty list. More... | |
LayoutPack (Layout layout, LayoutState layoutState, ManiaMapSettings settings=null) | |
Initializes a new object. More... | |
Properties | |
Layout | Layout [get] |
The layout. More... | |
RectangleInt | LayoutBounds [get] |
The bounds of the layout. More... | |
LayoutState | LayoutState [get] |
The layout state. More... | |
Dictionary< Uid, List< DoorConnection > > | RoomConnections = new Dictionary<Uid, List<DoorConnection>>() [get] |
A dictionary of door connections by room ID. More... | |
Dictionary< Uid, List< DoorPosition > > | RoomDoors = new Dictionary<Uid, List<DoorPosition>>() [get] |
A dictionary of door positions by room ID. More... | |
Dictionary< int, List< Room > > | RoomsByLayer = new Dictionary<int, List<Room>>() [get] |
A dictionary of rooms by layer coordinate. More... | |
ManiaMapSettings | Settings [get] |
The applied settings. More... | |
A manager for maintaining the current map data and state.
Definition at line 11 of file LayoutPack.cs.
LayoutPack | ( | Layout | layout, |
LayoutState | layoutState, | ||
ManiaMapSettings | settings = null |
||
) |
Initializes a new object.
layout | The layout. |
layoutState | The layout state. |
settings | The Mania Map settings. If null, a new instance with default settings will be used. |
System.ArgumentException | Raised if the layout or layout state is null or their ID's do not match. |
Definition at line 55 of file LayoutPack.cs.
bool DoorExists | ( | Uid | id, |
Vector2DInt | position, | ||
DoorDirection | direction | ||
) |
Returns true if the door exists for the specified cell index and direction.
id | The room ID. |
position | The cell index in the room. |
direction | The door direction. |
Definition at line 115 of file LayoutPack.cs.
DoorConnection FindDoorConnection | ( | Uid | id, |
Vector2DInt | position, | ||
DoorDirection | direction | ||
) |
Returns the door connection with the given room ID, position, and direction if it exists. Returns null if the connection does not exist.
id | The room ID. |
position | The cell position index. |
direction | The door direction. |
Definition at line 142 of file LayoutPack.cs.
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 exist, returns an empty list.
id | The room ID. |
Definition at line 78 of file LayoutPack.cs.
IEnumerable< int > GetLayerCoordinates | ( | ) |
Returns an enumerable of unique layer (z) coordinates for the layout. The coordinates are not in any particular order.
Definition at line 130 of file LayoutPack.cs.
IReadOnlyList< DoorPosition > GetRoomDoors | ( | Uid | id | ) |
Returns a list of door positions for the specified room ID. If the room ID does not exist, returns an empty list.
id | The room ID. |
Definition at line 102 of file LayoutPack.cs.
IReadOnlyList< Room > GetRoomsInLayer | ( | int | z | ) |
Returns a list of rooms corresponding to the specified layer (z) coordinate. If the layer does not exist, returns an empty list.
z | The layer coordinate. |
Definition at line 90 of file LayoutPack.cs.
|
get |
The layout.
Definition at line 16 of file LayoutPack.cs.
|
get |
The bounds of the layout.
Definition at line 46 of file LayoutPack.cs.
|
get |
The layout state.
Definition at line 21 of file LayoutPack.cs.
|
getprivate |
A dictionary of door connections by room ID.
Definition at line 31 of file LayoutPack.cs.
|
getprivate |
A dictionary of door positions by room ID.
Definition at line 41 of file LayoutPack.cs.
|
getprivate |
A dictionary of rooms by layer coordinate.
Definition at line 36 of file LayoutPack.cs.
|
get |
The applied settings.
Definition at line 26 of file LayoutPack.cs.