Table of Contents

Interface IWorldGenerator

Namespace
TileWorld.Engine.World.Generation
Assembly
TileWorld.Engine.dll

Produces deterministic chunk terrain and biome answers for a persisted world.

public interface IWorldGenerator

Properties

GeneratorId

Gets the stable generator identifier used in world metadata.

string GeneratorId { get; }

Property Value

string

GeneratorVersion

Gets the version number of the generator implementation.

int GeneratorVersion { get; }

Property Value

int

Methods

GenerateChunk(WorldGenerationContext, ChunkCoord)

Generates terrain for a chunk coordinate.

ChunkGenerationResult GenerateChunk(WorldGenerationContext context, ChunkCoord coord)

Parameters

context WorldGenerationContext

The generation context for the current world.

coord ChunkCoord

The chunk coordinate to generate.

Returns

ChunkGenerationResult

The generated chunk payload.

GetBiomeId(WorldGenerationContext, WorldTileCoord)

Resolves the biome identifier at a world-tile coordinate.

int GetBiomeId(WorldGenerationContext context, WorldTileCoord coord)

Parameters

context WorldGenerationContext

The generation context for the current world.

coord WorldTileCoord

The world-tile coordinate to inspect.

Returns

int

The biome identifier at the supplied coordinate.

GetSurfaceHeight(WorldGenerationContext, int)

Resolves the approximate terrain surface height at a world X coordinate.

int GetSurfaceHeight(WorldGenerationContext context, int worldX)

Parameters

context WorldGenerationContext

The generation context for the current world.

worldX int

The world X coordinate to inspect.

Returns

int

The terrain surface tile Y coordinate used by this generator.