mwg API
    Preparing search index...

    Interface CaveOptions

    interface CaveOptions {
        chambers: CaveChamber[];
        floor?: number;
        height: number;
        kinds?: TerrainKind[];
        mustBeClear?: readonly { x: number; y: number }[];
        random?: Random.RandomSource;
        seed?: number;
        shape?: LevelShape;
        starts?: CaveStart[];
        villageDensity?: number;
        wall?: number;
        width: number;
    }
    Index
    chambers: CaveChamber[]
    floor?: number
    height: number
    kinds?: TerrainKind[]

    extra terrain kinds beyond wall/floor, appended after them - a game's own ids

    mustBeClear?: readonly { x: number; y: number }[]

    cells that must end up floor whatever the rolls did, and reachable

    A stream to draw from instead of seeding one: the cave consumes it, so the caller's sequence advances and a replay of that sequence reproduces the cave. Wins over seed.

    seed?: number

    seeds the Random stream the cave is drawn from; required unless random is given

    shape?: LevelShape

    the grid the cave is carved on; defaults to 'square'

    starts?: CaveStart[]

    one start per side, placed on the named chamber's centre

    villageDensity?: number

    cleared cells per 1000 floor cells, returned as villages (the game decides what one means)

    wall?: number

    terrain ids to write; both must exist in the kinds passed to the Level

    width: number