Class OrderedMapAreaConnector
Same as ClosestMapAreaConnector, but connects random rooms instead of determining the closest one, or connects rooms in the order specified if you give it a list of areas.
Inheritance
Inherited Members
Namespace: GoRogue.MapGeneration.Connectors
Assembly: GoRogue.dll
Syntax
public static class OrderedMapAreaConnector
Methods
| Improve this Doc View SourceConnect(ISettableMapView<Boolean>, AdjacencyRule, IAreaConnectionPointSelector, ITunnelCreator, IGenerator, Boolean)
Connects the areas by determining all unique areas on the map given using a MapAreaFinder,
and then, if randomizeOrder
is true, performing a Fisher Yates shuffle of that
list of areas found. It then simply connects areas adjacent to each other in that list,
using the methods specified to determine points within two areas to connect, and how to
create the tunnel between the two points.
Declaration
public static void Connect(ISettableMapView<bool> map, AdjacencyRule adjacencyRule, IAreaConnectionPointSelector areaConnector = null, ITunnelCreator tunnelCreator = null, IGenerator rng = null, bool randomizeOrder = true)
Parameters
Type | Name | Description |
---|---|---|
ISettableMapView<System.Boolean> | map | The map to connect. |
AdjacencyRule | adjacencyRule | Method of adjacency to respect when determining map areas. Cannot be diagonal. |
IAreaConnectionPointSelector | areaConnector | The method to use to determine the points from two areas to make a tunnel between, in order to connect those two areas. If null is specified, a RandomConnectionPointSelector is used, that uses the RNG passed into this function. |
ITunnelCreator | tunnelCreator | The tunnel creation strategy to use. If null is specified, HorizontalVerticalTunnelCreator that utilizes the RNG passed into this function is used. |
Troschuetz.Random.IGenerator | rng | The rng to use. If null is specified, the default rng is assumed. |
System.Boolean | randomizeOrder | Whether or not to randomize which room is connected to which -- if this is set to false, they will be conencted in the exact order they are returned from the MapAreaFinder. |
Connect(ISettableMapView<Boolean>, IReadOnlyList<IReadOnlyMapArea>, IAreaConnectionPointSelector, ITunnelCreator)
Connects the areas by simply connecting areas adjacent to each other in the passed in list of areas, using the methods specified to determine points within two areas to connect, and how to create the tunnel between the two points.
Declaration
public static void Connect(ISettableMapView<bool> map, IReadOnlyList<IReadOnlyMapArea> mapAreas, IAreaConnectionPointSelector areaConnector = null, ITunnelCreator tunnelCreator = null)
Parameters
Type | Name | Description |
---|---|---|
ISettableMapView<System.Boolean> | map | The map to connect. |
System.Collections.Generic.IReadOnlyList<IReadOnlyMapArea> | mapAreas | The list of map areas to connect, in the order they should be connected. |
IAreaConnectionPointSelector | areaConnector | The method to use to determine the points from two areas to make a tunnel between, in order to connect those two areas. If null is specified, a RandomConnectionPointSelector is used, that uses the default RNG. |
ITunnelCreator | tunnelCreator | The tunnel creation strategy to use. If null is specified, a HorizontalVerticalTunnelCreator that utilizes the default RNG is used. |