Class RoomDoorConnector
Opens up room walls to connect tunnels that are placed near rooms.
Inheritance
Inherited Members
Namespace: GoRogue.MapGeneration.Connectors
Assembly: GoRogue.dll
Syntax
public static class RoomDoorConnector
Methods
| Improve this Doc View SourceConnectRooms(ArrayMap<Boolean>, IEnumerable<Rectangle>, Int32, Int32, Int32, Int32, Int32)
Detects tunnels near the specified rooms and tries to open a wall spot to represent a door.
Declaration
public static IEnumerable<(Rectangle Room, Coord[][] Connections)> ConnectRooms(ArrayMap<bool> map, IEnumerable<Rectangle> rooms, int minSidesToConnect = 1, int maxSidesToConnect = 4, int cancelSideConnectionSelectChance = 50, int cancelConnectionPlacementChance = 70, int cancelConnectionPlacementChanceIncrease = 10)
Parameters
Type | Name | Description |
---|---|---|
ArrayMap<System.Boolean> | map | The map to modify. |
System.Collections.Generic.IEnumerable<Rectangle> | rooms | A collection of rooms to process. |
System.Int32 | minSidesToConnect | Minimum sides of the room to process. Defaults to 1. |
System.Int32 | maxSidesToConnect | Maximum sides of the room to process. Defaults to 4. |
System.Int32 | cancelSideConnectionSelectChance | A chance out of 100 to cancel selecting sides to process (per room). Defaults to 50. |
System.Int32 | cancelConnectionPlacementChance | A chance out of 100 to cancel placing a door on a side after one has been placed (per room). Defaults to 70. |
System.Int32 | cancelConnectionPlacementChanceIncrease | Increase the |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<System.ValueTuple<Rectangle, Coord[][]>> | A list of rooms and the connections placed. |
ConnectRooms(ArrayMap<Boolean>, IGenerator, IEnumerable<Rectangle>, Int32, Int32, Int32, Int32, Int32)
Detects tunnels near the specified rooms and tries to open a wall spot to represent a door.
Declaration
public static IEnumerable<(Rectangle Room, Coord[][] Connections)> ConnectRooms(ArrayMap<bool> map, IGenerator rng, IEnumerable<Rectangle> rooms, int minSidesToConnect = 1, int maxSidesToConnect = 4, int cancelSideConnectionSelectChance = 50, int cancelConnectionPlacementChance = 70, int cancelConnectionPlacementChanceIncrease = 10)
Parameters
Type | Name | Description |
---|---|---|
ArrayMap<System.Boolean> | map | The map to modify. |
Troschuetz.Random.IGenerator | rng | The RNG to use. |
System.Collections.Generic.IEnumerable<Rectangle> | rooms | A collection of rooms to process. |
System.Int32 | minSidesToConnect | Minimum sides of the room to process. Defaults to 1. |
System.Int32 | maxSidesToConnect | Maximum sides of the room to process. Defaults to 4. |
System.Int32 | cancelSideConnectionSelectChance | A chance out of 100 to cancel selecting sides to process (per room). Defaults to 50. |
System.Int32 | cancelConnectionPlacementChance | A chance out of 100 to cancel placing a door on a side after one has been placed (per room). Defaults to 70. |
System.Int32 | cancelConnectionPlacementChanceIncrease | Increase the |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<System.ValueTuple<Rectangle, Coord[][]>> | A list of rooms and the connections placed. |