Show / Hide Table of Contents

Class MapAreaFinder

Class designed to calculate and produce a list of MapAreas representing each unique connected area of the map.

Inheritance
System.Object
MapAreaFinder
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: GoRogue.MapGeneration
Assembly: GoRogue.dll
Syntax
public class MapAreaFinder
Remarks

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 Source

MapAreaFinder(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 Source

AdjacencyMethod

The method used for determining connectivity of the grid.

Declaration
public AdjacencyRule AdjacencyMethod
Field Value
Type Description
AdjacencyRule
| Improve this Doc View Source

Map

Map view indicating which cells should be considered part of a map area and which should not.

Declaration
public IMapView<bool> Map
Field Value
Type Description
IMapView<System.Boolean>

Methods

| Improve this Doc View Source

MapAreas()

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.

| Improve this Doc View Source

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.

Extension Methods

Utility.Yield<T>(T)
  • Improve this Doc
  • View Source
Back to top Generated by DocFX