mwg API
    Preparing search index...

    Interface RoomBuilder

    How one room's interior gets carved.

    The generator decides where rooms go and what joins them; a builder decides what a room actually looks like once it has a rectangle to fill. That split is what makes them composable: a game registers a hall, a pillared chamber, a circular vault and a flooded cistern, and any floor is some mixture of them without the generator knowing what a pillar or a cistern is. mwg ships exactly one builder (hallBuilder, a plain filled rectangle, which is what the generator did unconditionally before builders existed) and expects a game to bring the rest, the same boundary every other module here draws around content.

    interface RoomBuilder {
        id: string;
        maxSize?: number;
        minSize?: number;
        weight?: number;
        paint(level: Level, room: Roguelike.Rect, floor: number): void;
    }
    Index
    id: string

    recorded per room in the generation result, for a parity trace or a game's own bookkeeping

    maxSize?: number

    largest room it can fill; a builder wanting only small rooms sets this

    minSize?: number

    smallest room this builder can fill, in cells, on either axis

    weight?: number

    relative weight against the other eligible builders; defaults to 1