Show / Hide Table of Contents

Class RandomViewFill

Randomly fills a boolean IGridView<T> with true/false values. Creates a grid view with the given tag if none is present.

Inheritance
object
GenerationStep
RandomViewFill
Inherited Members
GenerationStep.Name
GenerationStep.PerformStep(GenerationContext)
GenerationStep.GetStageEnumerator(GenerationContext)
GenerationStep.RequiredComponents
object.GetType()
object.MemberwiseClone()
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
Namespace: GoRogue.MapGeneration.Steps
Assembly: GoRogue.dll
Syntax
public class RandomViewFill : GenerationStep

Constructors

View Source

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

ExcludePerimeterPoints

Whether or not to exclude the perimeter points from the random fill.

Declaration
public bool ExcludePerimeterPoints
Field Value
Type Description
bool
View Source

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
View Source

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
View Source

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
View Source

RNG

The RNG to use for filling the view.

Declaration
public IEnhancedRandom RNG
Field Value
Type Description
IEnhancedRandom

Methods

View Source

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)
  • View Source
In this article
Back to top Generated by DocFX