Class RandomViewFill
Randomly fills a boolean IGridView<T> with true/false values. Creates a grid view with the given tag if none is present.
Inherited Members
Namespace: GoRogue.MapGeneration.Steps
Assembly: GoRogue.dll
Syntax
public class RandomViewFill : GenerationStep
Constructors
View SourceRandomViewFill(string?, string?)
Creates a new step for applying random values to a map view.
Declaration
public RandomViewFill(string? name = null, string? gridViewComponentTag = "WallFloor")
Parameters
Type | Name | Description |
---|---|---|
string | name | The name of the generation step. Defaults to RandomViewFill. |
string | gridViewComponentTag | Optional tag that must be associated with the grid view that random values are set to. Defaults to "WallFloor". |
Fields
View SourceExcludePerimeterPoints
Whether or not to exclude the perimeter points from the random fill.
Declaration
public bool ExcludePerimeterPoints
Field Value
Type | Description |
---|---|
bool |
FillProbability
Represents the percent chance that a given cell will be a floor cell when the map is initially randomly filled.
Declaration
public float FillProbability
Field Value
Type | Description |
---|---|
float |
FillsBetweenPauses
How many squares to fill before yield returning for a pause. Defaults to no pauses (0).
Declaration
public uint FillsBetweenPauses
Field Value
Type | Description |
---|---|
uint |
GridViewComponentTag
Optional tag that must be associated with the grid view that random values are set to.
Declaration
public readonly string? GridViewComponentTag
Field Value
Type | Description |
---|---|
string |
RNG
The RNG to use for filling the view.
Declaration
public IEnhancedRandom RNG
Field Value
Type | Description |
---|---|
IEnhancedRandom |
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> |