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:
Component | Default 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.
Inherited Members
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
View SourceRectangleGenerator(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
View SourceWallFloorComponentTag
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> |