Class CellularAutomataAreaGeneration
Uses a cellular automata smoothing algorithm to smooth areas on the given map.
Inherited Members
Namespace: GoRogue.MapGeneration.Steps
Assembly: GoRogue.dll
Syntax
public class CellularAutomataAreaGeneration : GenerationStep
Constructors
View SourceCellularAutomataAreaGeneration(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
View SourceAreaAdjacencyRule
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 |
|---|---|
| int |
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 |
|---|---|
| int |
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
View SourceOnPerform(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> |