Class MapAreaFinder
Class designed to calculate and produce a list of MapAreas representing each unique connected area of the map.
Inheritance
Inherited Members
Namespace: GoRogue.MapGeneration
Assembly: GoRogue.dll
Syntax
public class MapAreaFinderRemarks
The class takes in an IMapView<T>, where a value of true for a given position indicates it should be part of a map area, and false indicates it should not be part of any map area. In a classic roguelike dungeon example, this might be a walkability map where floors return a value of true and walls a value of false.
Constructors
| Improve this Doc View SourceMapAreaFinder(IMapView<Boolean>, AdjacencyRule)
Constructor.
Declaration
public MapAreaFinder(IMapView<bool> map, AdjacencyRule adjacencyMethod)Parameters
| Type | Name | Description | 
|---|---|---|
| IMapView<System.Boolean> | map | Map view indicating which cells should be considered part of a map area and which should not. | 
| AdjacencyRule | adjacencyMethod | The method used for determining connectivity of the grid. | 
Fields
| Improve this Doc View SourceAdjacencyMethod
The method used for determining connectivity of the grid.
Declaration
public AdjacencyRule AdjacencyMethodField Value
| Type | Description | 
|---|---|
| AdjacencyRule | 
Map
Map view indicating which cells should be considered part of a map area and which should not.
Declaration
public IMapView<bool> MapField Value
| Type | Description | 
|---|---|
| IMapView<System.Boolean> | 
Methods
| Improve this Doc View SourceMapAreas()
Calculates the list of map areas, returning each unique map area.
Declaration
public IEnumerable<MapArea> MapAreas()Returns
| Type | Description | 
|---|---|
| System.Collections.Generic.IEnumerable<MapArea> | An IEnumerable of each (unique) map area. | 
MapAreasFor(IMapView<Boolean>, AdjacencyRule)
Convenience function that creates a MapAreaFinder and returns the result of that instances MapAreas() function. Intended to be used for cases in which the area finder will never be re-used.
Declaration
public static IEnumerable<MapArea> MapAreasFor(IMapView<bool> map, AdjacencyRule adjacencyMethod)Parameters
| Type | Name | Description | 
|---|---|---|
| IMapView<System.Boolean> | map | Map view indicating which cells should be considered part of a map area and which should not. | 
| AdjacencyRule | adjacencyMethod | The method used for determining connectivity of the grid. | 
Returns
| Type | Description | 
|---|---|
| System.Collections.Generic.IEnumerable<MapArea> | An IEnumerable of each (unique) map area. |