C# Класс ByChance.Levels3D.LevelGenerator3D

Generates a 3D level based on a given chunk library.
Наследование: LevelGenerator
Показать файл Открыть проект

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

Метод Описание
AddChunk ( ChunkLibrary3D chunkLibrary, Level3D level, Random2 random ) : bool

Expands the passed level at any free context.

AddChunk ( ChunkLibrary3D chunkLibrary, Level3D level, Random2 random, Context3D freeContext ) : bool

Expands the passed level at the specified free context.

AddRandomChunk ( ChunkLibrary3D chunkLibrary, Level3D 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 ( ChunkLibrary3D chunkLibrary, Vector3F levelExtents ) : Level3D

Generates a 3D level with the given chunk library and desired dimensions for the level.

GenerateLevel ( ChunkLibrary3D chunkLibrary, Vector3F levelExtents, Random2 random ) : Level3D

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

GenerateLevel ( ChunkLibrary3D chunkLibrary, Level3D level ) : void

Generates a 3D level with the given chunk library and level.

GenerateLevel ( ChunkLibrary3D chunkLibrary, Level3D level, Random2 random ) : void

Generates a 3D level with the given chunk library, level and random number generator.

PostProcessLevel ( Level3D 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 ( ChunkLibrary3D chunkLibrary, Level3D level, Random2 random ) : bool
chunkLibrary ChunkLibrary3D /// Chunk library that holds all chunk templates to use for the level generation. ///
level Level3D 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 ( ChunkLibrary3D chunkLibrary, Level3D level, Random2 random, Context3D freeContext ) : bool
chunkLibrary ChunkLibrary3D /// Chunk library that holds all chunk templates to use for the level generation. ///
level Level3D Level to fill during the level generation process.
random ByChance.Core.Random2 Random number generator to use for the level generation.
freeContext Context3D 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 ( ChunkLibrary3D chunkLibrary, Level3D level, Random2 random ) : void
chunkLibrary ChunkLibrary3D /// Chunk library that holds all chunk templates to use for the level generation. ///
level Level3D 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 3D level with the given chunk library and desired dimensions for the level.
public GenerateLevel ( ChunkLibrary3D chunkLibrary, Vector3F levelExtents ) : Level3D
chunkLibrary ChunkLibrary3D /// Chunk library that holds all chunk templates to use for the level generation. ///
levelExtents Vector3F Width, height and depth the resulting level should have.
Результат Level3D

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

Generates a 3D level with the given chunk library, desired dimensions for the level and random number generator.
/// Level width, height or depth is smaller than or equal to zero. ///
public GenerateLevel ( ChunkLibrary3D chunkLibrary, Vector3F levelExtents, Random2 random ) : Level3D
chunkLibrary ChunkLibrary3D /// Chunk library that holds all chunk templates to use for the level generation. ///
levelExtents Vector3F Width, height and depth the resulting level should have.
random ByChance.Core.Random2 Random number generator to use for the level generation.
Результат Level3D

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

Generates a 3D level with the given chunk library and level.
public GenerateLevel ( ChunkLibrary3D chunkLibrary, Level3D level ) : void
chunkLibrary ChunkLibrary3D /// Chunk library that holds all chunk templates to use for the level generation. ///
level Level3D Level to fill during the level generation process.
Результат void

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

Generates a 3D level with the given chunk library, level and random number generator.
public GenerateLevel ( ChunkLibrary3D chunkLibrary, Level3D level, Random2 random ) : void
chunkLibrary ChunkLibrary3D /// Chunk library that holds all chunk templates to use for the level generation. ///
level Level3D 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 ( Level3D level ) : void
level Level3D Level to process.
Результат void