C# Класс ByChance.Levels2D.ChunkTemplate2D

Template that is used for creating similar chunks, which in turn make up a 2D 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.
Наследование: ByChance.Core.ChunkTemplate
Показать файл Открыть проект

Открытые методы

Метод Описание
AddAnchor ( Vector2F 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 ( Vector2F relativePosition ) : void

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

AddContext ( Vector2F 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.

ChunkTemplate2D ( Vector2F extents, int weight ) : System

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

ChunkTemplate2D ( Vector2F extents, int weight, string tag, bool allowChunkRotation ) : System

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

Приватные методы

Метод Описание
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.

ChunkTemplate2D ( Vector2F extents ) : System
ChunkTemplate2D ( Vector2F extents, bool allowChunkRotation ) : System
ChunkTemplate2D ( Vector2F extents, string tag ) : System

Описание методов

AddAnchor() публичный Метод

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 ( Vector2F relativePosition, string tag ) : void
relativePosition Vector2F /// Position of the new anchor relative to the /// positions of the chunks constructed with this template. ///
tag string Category of the new anchor.
Результат void

AddContext() публичный Метод

Adds a new context at the passed position relative to the positions of the chunks constructed with this template.
public AddContext ( Vector2F relativePosition ) : void
relativePosition Vector2F /// Position of the new context relative to the /// positions of the chunks constructed with this template. ///
Результат void

AddContext() публичный Метод

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 ( Vector2F relativePosition, string tag ) : void
relativePosition Vector2F /// Position of the new context relative to the /// positions of the chunks constructed with this template. ///
tag string Category of the new context.
Результат void

ChunkTemplate2D() публичный Метод

Constructs a new chunk template for chunks with the specified width and height and the passed weight. Chunks constructed with this template may not be rotated by the level generator.
is less than or equal to zero.
public ChunkTemplate2D ( Vector2F extents, int weight ) : System
extents Vector2F Width and height of the chunks to construct a new template for.
weight int Relative weight of the new chunk template.
Результат System

ChunkTemplate2D() публичный Метод

Constructs a new chunk template for chunks with the specified width, height, weight, category and rotation permission.
Width, height or is less then or equal to zero. is null.
public ChunkTemplate2D ( Vector2F extents, int weight, string tag, bool allowChunkRotation ) : System
extents Vector2F Width and height 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.
Результат System