C# 클래스 ByChance.Core.Chunk

Main building block that makes up a level.

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.

The concrete 2D and 3D implementations of this base class hold additional information regarding their absolute position within the level and their size.

파일 보기 프로젝트 열기: npruehs/bychance 1 사용 예제들

공개 메소드들

메소드 설명
GetAlignedContextCount ( ) : int

Gets the total number of aligned (used) contexts of this chunk.

GetAnchor ( int index ) : Anchor

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

GetContext ( int index ) : Context

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

RemoveContext ( Context context ) : bool

Removes passed context from the chunk's list of contexts.

보호된 메소드들

메소드 설명
Chunk ( ChunkTemplate template ) : System

Constructs a new, empty chunk with a reference to the passed chunk template.

비공개 메소드들

메소드 설명
Rotate ( ) : bool

Rotates the chunk by 90°.

Actual rotation algorithm is implemented by the concrete 2D and 3D chunk classes.

메소드 상세

Chunk() 보호된 메소드

Constructs a new, empty chunk with a reference to the passed chunk template.
is null.
protected Chunk ( ChunkTemplate template ) : System
template ChunkTemplate Chunk template the new chunk will be based on.
리턴 System

GetAlignedContextCount() 공개 메소드

Gets the total number of aligned (used) contexts of this chunk.
public GetAlignedContextCount ( ) : int
리턴 int

GetAnchor() 공개 메소드

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

GetContext() 공개 메소드

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

RemoveContext() 공개 메소드

Removes passed context from the chunk's list of contexts.
is null.
public RemoveContext ( Context context ) : bool
context Context Context to be removed.
리턴 bool