Class RectanglesToAreas
"Translation" step that takes as input an ItemList<TItem>, and transforms it into an ItemList<TItem>. Can optionally remove the ItemList<TItem> from the context. Context Components Required:
- ItemList<TItem> (tag RectanglesComponentTag): The list of rectangles to translate to areas Context Components Added/Used
- ItemList<TItem> (tag AreasComponentTag): The list of areas to add the areas representing the rectangles to. If it does not exist, it will be created.
Inherited Members
Namespace: GoRogue.MapGeneration.Steps.Translation
Assembly: GoRogue.dll
Syntax
public class RectanglesToAreas : GenerationStep
Constructors
RectanglesToAreas(String, String)
Creates a new step for translation of Rectangle lists to Area lists, with the name RectanglesToAreas.
Declaration
public RectanglesToAreas(string rectanglesComponentTag, string areasComponentTag)
Parameters
Type | Name | Description |
---|---|---|
String | rectanglesComponentTag | Tag that must be associated with the component used as input rectangles. |
String | areasComponentTag | Tag that must be associated with the component used to store the resulting areas. |
RectanglesToAreas(String, String, String)
Declaration
public RectanglesToAreas(string name, string rectanglesComponentTag, string areasComponentTag)
Parameters
Type | Name | Description |
---|---|---|
String | name | The name of the generation step. Defaults to RectanglesToAreas. |
String | rectanglesComponentTag | Tag that must be associated with the component used as input rectangles. |
String | areasComponentTag | Tag that must be associated with the component used to store the resulting areas. |
Fields
AreasComponentTag
Tag that must be associated with the component used to store the resulting areas.
Declaration
public readonly string AreasComponentTag
Field Value
Type | Description |
---|---|
String |
RectanglesComponentTag
Tag that must be associated with the component used as input rectangles.
Declaration
public readonly string RectanglesComponentTag
Field Value
Type | Description |
---|---|
String |
RemoveSourceComponent
Whether or not to remove the input list of rectangles from the context. Defaults to false.
Declaration
public bool RemoveSourceComponent
Field Value
Type | Description |
---|---|
Boolean |
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> |