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
GeneratorVersion
Gets the version number of the generator implementation.
int GeneratorVersion { get; }
Property Value
Methods
GenerateChunk(WorldGenerationContext, ChunkCoord)
Generates terrain for a chunk coordinate.
ChunkGenerationResult GenerateChunk(WorldGenerationContext context, ChunkCoord coord)
Parameters
contextWorldGenerationContextThe generation context for the current world.
coordChunkCoordThe 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
contextWorldGenerationContextThe generation context for the current world.
coordWorldTileCoordThe 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
contextWorldGenerationContextThe generation context for the current world.
worldXintThe world X coordinate to inspect.
Returns
- int
The terrain surface tile Y coordinate used by this generator.