C# 클래스 ByChance.Levels2D.LevelGenerator2D

Generates a 3D level based on a given chunk library.
상속: LevelGenerator
파일 보기 프로젝트 열기: npruehs/bychance

공개 메소드들

메소드 설명
AddChunk ( ChunkLibrary2D chunkLibrary, Level2D level, Random2 random ) : bool

Expands the passed level at any free context.

AddChunk ( ChunkLibrary2D chunkLibrary, Level2D level, Random2 random, Context2D freeContext ) : bool

Expands the passed level at the specified free context.

AddRandomChunk ( ChunkLibrary2D chunkLibrary, Level2D level, Random2 random ) : void

Adds a random chunk to the passed level at a random position, without checking for any intersections with the level bounds or other chunks and without aligning it to any other chunk.

GenerateLevel ( ChunkLibrary2D chunkLibrary, Vector2F levelExtents ) : Level2D

Generates a 2D level using the given chunk library and desired dimensions for the level.

GenerateLevel ( ChunkLibrary2D chunkLibrary, Vector2F levelExtents, Random2 random ) : Level2D

Generates a 2D level using the given chunk library, desired dimensions for the level and random number generator.

GenerateLevel ( ChunkLibrary2D chunkLibrary, Level2D level ) : void

Generates a 2D level using the given chunk library and level.

GenerateLevel ( ChunkLibrary2D chunkLibrary, Level2D level, Random2 random ) : void

Generates a 2D level using the given chunk library, level and random number generator.

PostProcessLevel ( Level2D level ) : void

Applies all available post-processing policies to the passed level.

보호된 메소드들

메소드 설명
ConstructChunkFromTemplate ( ChunkTemplate chunkTemplate ) : Chunk

Factory method that returns a new chunk based on the given chunk template that the type of the chunk template and of the chunks in the level.

메소드 상세

AddChunk() 공개 메소드

Expands the passed level at any free context.
/// , or is null. /// /// is empty, or the types of and don't match. ///
public AddChunk ( ChunkLibrary2D chunkLibrary, Level2D level, Random2 random ) : bool
chunkLibrary ChunkLibrary2D /// Chunk library that holds all chunk templates to use for the level generation. ///
level Level2D Level to fill during the level generation process.
random ByChance.Core.Random2 Random number generator to use for the level generation.
리턴 bool

AddChunk() 공개 메소드

Expands the passed level at the specified free context.
/// , or is null. /// /// is empty, or the types of and don't match. /// /// is already blocked or aligned. ///
public AddChunk ( ChunkLibrary2D chunkLibrary, Level2D level, Random2 random, Context2D freeContext ) : bool
chunkLibrary ChunkLibrary2D /// Chunk library that holds all chunk templates to use for the level generation. ///
level Level2D Level to fill during the level generation process.
random ByChance.Core.Random2 Random number generator to use for the level generation.
freeContext Context2D Context to expland the level at.
리턴 bool

AddRandomChunk() 공개 메소드

Adds a random chunk to the passed level at a random position, without checking for any intersections with the level bounds or other chunks and without aligning it to any other chunk.
public AddRandomChunk ( ChunkLibrary2D chunkLibrary, Level2D level, Random2 random ) : void
chunkLibrary ChunkLibrary2D /// Chunk library that holds all chunk templates to use for the level generation. ///
level Level2D Level to fill during the level generation process.
random ByChance.Core.Random2 Random number generator to use for the level generation.
리턴 void

ConstructChunkFromTemplate() 보호된 메소드

Factory method that returns a new chunk based on the given chunk template that the type of the chunk template and of the chunks in the level.
/// The type of the passed chunktemplate doesn't match the desired chunk type. ///
protected ConstructChunkFromTemplate ( ChunkTemplate chunkTemplate ) : Chunk
chunkTemplate ByChance.Core.ChunkTemplate Chunk template the returned chunk should be based on.
리턴 ByChance.Core.Chunk

GenerateLevel() 공개 메소드

Generates a 2D level using the given chunk library and desired dimensions for the level.
public GenerateLevel ( ChunkLibrary2D chunkLibrary, Vector2F levelExtents ) : Level2D
chunkLibrary ChunkLibrary2D /// Chunk library that holds all chunk templates to use for the level generation. ///
levelExtents Vector2F Width and height the resulting level should have.
리턴 Level2D

GenerateLevel() 공개 메소드

Generates a 2D level using the given chunk library, desired dimensions for the level and random number generator.
/// Level width or height is smaller than or equal to zero. ///
public GenerateLevel ( ChunkLibrary2D chunkLibrary, Vector2F levelExtents, Random2 random ) : Level2D
chunkLibrary ChunkLibrary2D /// Chunk library that holds all chunk templates to use for the level generation. ///
levelExtents Vector2F Width and height the resulting level should have.
random ByChance.Core.Random2 Random number generator to use for the level generation.
리턴 Level2D

GenerateLevel() 공개 메소드

Generates a 2D level using the given chunk library and level.
public GenerateLevel ( ChunkLibrary2D chunkLibrary, Level2D level ) : void
chunkLibrary ChunkLibrary2D /// Chunk library that holds all chunk templates to use for the level generation. ///
level Level2D Level to fill during the level generation process.
리턴 void

GenerateLevel() 공개 메소드

Generates a 2D level using the given chunk library, level and random number generator.
public GenerateLevel ( ChunkLibrary2D chunkLibrary, Level2D level, Random2 random ) : void
chunkLibrary ChunkLibrary2D /// Chunk library that holds all chunk templates to use for the level generation. ///
level Level2D Level to fill during the level generation process.
random ByChance.Core.Random2 Random number generator to use for the level generation.
리턴 void

PostProcessLevel() 공개 메소드

Applies all available post-processing policies to the passed level.
public PostProcessLevel ( Level2D level ) : void
level Level2D Level to process.
리턴 void