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

Main building block that makes up a 2D level, providing extents, position and rotation.

Chunks are created based on pre-defined chunk templates and define the positions of all contexts and anchors associated with the chunk, 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.Chunk
Показать файл Открыть проект

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

Метод Описание
Chunk2D ( ChunkTemplate chunkTemplate ) : System

Constructs a new chunk with a reference to the passed chunk template, using that template's width and height and performing deep copies of the lists of contexts and anchors of that template.

ToString ( ) : string

Returns the position of this chunk within the level as string.

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

Метод Описание
Rotate ( ) : bool

Rotates this chunk clock-wise by 90°, changing the positions of all contexts and switching width and height.

SetPosition ( Vector2F position ) : void

Sets the position of this chunk within the level and changes the relative positions of all anchors of this chunk to match its rotation.

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

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

Constructs a new chunk with a reference to the passed chunk template, using that template's width and height and performing deep copies of the lists of contexts and anchors of that template.
is null. is not of the type .
public Chunk2D ( ChunkTemplate chunkTemplate ) : System
chunkTemplate ByChance.Core.ChunkTemplate Chunk template the new chunk will be based on.
Результат System

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

Returns the position of this chunk within the level as string.
public ToString ( ) : string
Результат string