hex-world
    Preparing search index...

    Interface MapGeneratorPlugin<TConfig>

    Common interface for all map generators. Raw generator functions remain exported for library consumers; this interface is for the demo/game plugin system (dropdown + R/G keys).

    interface MapGeneratorPlugin<TConfig = unknown> {
        id: string;
        name: string;
        defaultConfig: TConfig;
        configSchema?: ConfigFieldDescriptor[];
        generate(map: HexMap, config: TConfig, seed: number): void;
        generateSteps?(
            map: HexMap,
            config: TConfig,
            seed: number,
        ): Generator<GenerationProgress, void>;
    }

    Type Parameters

    • TConfig = unknown
    Index

    Properties

    id: string

    Unique registry key, e.g. 'fbm'.

    name: string

    Display name shown in UI, e.g. 'FBM (fast)'.

    defaultConfig: TConfig

    Starting config — used to populate controls and as serialisation baseline.

    configSchema?: ConfigFieldDescriptor[]

    Describes every user-facing config field for generic UI rendering. Internal fields (noise offsets, jitter channels, etc.) are omitted. Keys use dot notation for nested paths.

    Methods

    • Fills every cell of an already-constructed, already-cleared map. Caller owns the map; the plugin does not resize or recreate it. Same seed + same config + same map dimensions must always produce the same result.

      Parameters

      Returns void