C# Class ByChance.Core.ChunkTemplate

Template that is used for creating similar chunks, which in turn make up a level. Chunk templates define the positions of all contexts and anchors of chunks, as well as attributes that are required for the level generation process such as the probability of a chunk being picked to be added next.
Show file Open project: npruehs/bychance Class Usage Examples

Public Methods

Method Description
GetAnchor ( int index ) : Anchor

Gets the anchor with the specified template-wide unique index.

GetContext ( int index ) : Context

Gets the context with the specified template-wide unique index.

Protected Methods

Method Description
ChunkTemplate ( int weight, string tag, bool allowChunkRotation ) : System

Constructs a new chunk template with the specified weight, category and rotation permission.

Method Details

ChunkTemplate() protected method

Constructs a new chunk template with the specified weight, category and rotation permission.
is less then or equal to zero. is null.
protected ChunkTemplate ( int weight, string tag, bool allowChunkRotation ) : System
weight int Relative weight of the new chunk template.
tag string Category of the new chunk template.
allowChunkRotation bool Whether the level generator is allowed to rotate chunks created with the template by 90°, or not.
return System

GetAnchor() public method

Gets the anchor with the specified template-wide unique index.
public GetAnchor ( int index ) : Anchor
index int Index of the anchor to get.
return Anchor

GetContext() public method

Gets the context with the specified template-wide unique index.
public GetContext ( int index ) : Context
index int Index of the context to get.
return Context