C# Class ByChance.Levels3D.ChunkTemplate3D

Template that is used for creating similar chunks, which in turn make up a 3D level. Chunk templates define the chunk extents, 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.
Inheritance: ByChance.Core.ChunkTemplate
Show file Open project: npruehs/bychance

Public Methods

Method Description
AddAnchor ( Vector3F relativePosition ) : void

Adds a new anchor at the passed position relative to the positions of the chunks constructed with this template.

AddAnchor ( Vector3F relativePosition, string tag ) : void

Adds a new anchor of the specified category at the passed position relative to the positions of the chunks constructed with this template.

AddContext ( Vector3F relativePosition ) : void

Adds a new context at the passed position relative to the positions of the chunks constructed with this template.

AddContext ( Vector3F relativePosition, string tag ) : void

Adds a new context of the specified category at the passed position relative to the positions of the chunks constructed with this template.

ChunkTemplate3D ( Vector3F extents, int weight ) : System

Constructs a new chunk template for chunks with the specified width, height and depth and the passed weight. Chunks constructed with this template may not be rotated by the level generator.

ChunkTemplate3D ( Vector3F extents, int weight, string tag, bool allowChunkRotation ) : System

Constructs a new chunk template for chunks with the specified width, height, depth, weight, category and rotation permission.

Private Methods

Method Description
AddAnchor ( Anchor anchor ) : void

Adds the passed anchor to the list of anchors of this chunk template and sets its chunk-wide unique index.

AddContext ( Context context ) : void

Adds the passed context to the list of contexts of this chunk template and sets its chunk-wide unique index.

ChunkTemplate3D ( Vector3F extents ) : System
ChunkTemplate3D ( Vector3F extents, bool allowChunkRotation ) : System
ChunkTemplate3D ( Vector3F extents, string tag ) : System

Method Details

AddAnchor() public method

Adds a new anchor at the passed position relative to the positions of the chunks constructed with this template.
public AddAnchor ( Vector3F relativePosition ) : void
relativePosition Vector3F /// Position of the new anchor relative to the /// positions of the chunks constructed with this template. ///
return void

AddAnchor() public method

Adds a new anchor of the specified category at the passed position relative to the positions of the chunks constructed with this template.
public AddAnchor ( Vector3F relativePosition, string tag ) : void
relativePosition Vector3F /// Position of the new context relative to the /// positions of the chunks constructed with this template. ///
tag string Category of the new anchor.
return void

AddContext() public method

Adds a new context at the passed position relative to the positions of the chunks constructed with this template.
public AddContext ( Vector3F relativePosition ) : void
relativePosition Vector3F /// Position of the new context relative to the /// positions of the chunks constructed with this template. ///
return void

AddContext() public method

Adds a new context of the specified category at the passed position relative to the positions of the chunks constructed with this template.
public AddContext ( Vector3F relativePosition, string tag ) : void
relativePosition Vector3F /// Position of the new context relative to the /// positions of the chunks constructed with this template. ///
tag string Category of the new context.
return void

ChunkTemplate3D() public method

Constructs a new chunk template for chunks with the specified width, height and depth and the passed weight. Chunks constructed with this template may not be rotated by the level generator.
is less then or equal to zero.
public ChunkTemplate3D ( Vector3F extents, int weight ) : System
extents Vector3F Width, height and depth of the chunks to construct a new template for.
weight int Relative weight of the new chunk template.
return System

ChunkTemplate3D() public method

Constructs a new chunk template for chunks with the specified width, height, depth, weight, category and rotation permission.
Width, height, depth or weight is less then or equal to zero. is null.
public ChunkTemplate3D ( Vector3F extents, int weight, string tag, bool allowChunkRotation ) : System
extents Vector3F Width, height and depth of the chunks to construct a new template for.
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