Show / Hide Table of Contents

Class CellularAutomataAreaGeneration

Uses a cellular automata smoothing algorithm to smooth areas on the given map.

Inheritance
Object
GenerationStep
CellularAutomataAreaGeneration
Inherited Members
GenerationStep.Name
GenerationStep.PerformStep(GenerationContext)
GenerationStep.GetStageEnumerator(GenerationContext)
GenerationStep.RequiredComponents
Namespace: GoRogue.MapGeneration.Steps
Assembly: GoRogue.dll
Syntax
public class CellularAutomataAreaGeneration : GenerationStep

Constructors

CellularAutomataAreaGeneration(String, String)

Creates a new cellular automata based area generation step.

Declaration
public CellularAutomataAreaGeneration(string name = null, string wallFloorComponentTag = "WallFloor")
Parameters
Type Name Description
String name

The name of the generation step. Defaults to CellularAutomataAreaGeneration.

String wallFloorComponentTag

Optional tag that must be associated with the map view component used to store/set floor/wall status. Defaults to "WallFloor".

Fields

AreaAdjacencyRule

The adjacency rule to use to determine the unique areas generated by this algorithm.

Declaration
public AdjacencyRule AreaAdjacencyRule
Field Value
Type Description
AdjacencyRule

CutoffBigAreaFill

Total number of times the cellular automata smoothing variation that is more likely to result in "breaking up" large areas will be run before switching to the more standard nearest neighbors version. Must be less than or equal to TotalIterations. Recommended to be in range [2, 7].

Declaration
public int CutoffBigAreaFill
Field Value
Type Description
Int32

TotalIterations

Total number of times the cellular automata-based smoothing algorithm is executed. Recommended to be in range [2, 10].

Declaration
public int TotalIterations
Field Value
Type Description
Int32

WallFloorComponentTag

Optional tag that must be associated with the component used to set wall/floor status of tiles changed by this algorithm.

Declaration
public readonly string WallFloorComponentTag
Field Value
Type Description
String

Methods

OnPerform(GenerationContext)

Implement to perform the actual work of the generation step. Use "yield return null" to indicate the end of a "stage", eg. a point where execution can be paused when using GetStageEnumerator().

Declaration
protected override IEnumerator<object> OnPerform(GenerationContext context)
Parameters
Type Name Description
GenerationContext context

Context to perform the generation step on.

Returns
Type Description
IEnumerator<Object>
Overrides
GenerationStep.OnPerform(GenerationContext)

Extension Methods

Utility.Yield<T>(T)
In This Article
Back to top Generated by DocFX