Table of Contents

Class TerrainLoader

Namespace
Core.Loaders
Assembly
Core.dll

Loads terrain type definitions from terrain.json5. This is the single source of truth for terrain definitions. TerrainColorMapper (Map layer) should use the same file.

Terrain IDs are assigned sequentially based on order in the file, ensuring consistency between Core and Map layers.

[LoaderMetadata("terrain", Description = "Load terrain type definitions", Priority = 10, Required = true)]
public class TerrainLoader : ILoaderFactory
Inheritance
object
TerrainLoader
Implements

Methods

Load(LoaderContext)

Load data into registries from the specified data path.

public void Load(LoaderContext context)

Parameters

context LoaderContext

Loading context with registries and settings

LoadTerrains(Registry<TerrainData>, string)

Load all terrain types from map/terrain.json5 file.

public static void LoadTerrains(Registry<TerrainData> terrainRegistry, string dataPath)

Parameters

terrainRegistry Registry<TerrainData>
dataPath string