Show / Hide Table of Contents

Class RectangleGenerator

Produces a very simple map that is entirely floor, with a single-thick outline of walls around the outside.

Context Components Required:

  • None Context Components Added/Used:
ComponentDefault Tag
ISettableGridView<T> where T is bool"WallFloor"

An existing wall-floor component used if one is present; if not, a new one is added.

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

This generation step simply turns the map into a giant rectangular room. It sets the interior positions to true, and outer-edge points to false, in the map context's map view with the given tag. If the GenerationContext has an existing map view context component, that component is used. If not, an ArrayView<T> where T is bool is created and added to the map context, whose width/height match Width/Height.

Constructors

RectangleGenerator(String)

Creates a new rectangle map generation step.

Declaration
public RectangleGenerator(string wallFloorComponentTag = "WallFloor")
Parameters
Type Name Description
String wallFloorComponentTag

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

Fields

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