mwg API
    Preparing search index...

    Interface AutomapRule

    One automapping rule: a 2D pattern to find, and what to write where it matches.

    This is Tiled's automapping, minus the editor: input_* layers are arbitrary 2D patterns (not just one cell's 8 neighbours, unlike blob autotiling) matched anywhere against the map, and the paired output_* layers replace what matched. EMPTY is the wildcard on the way in (an empty input tile constrains nothing) and a no-op on the way out (an empty output tile leaves the cell alone).

    interface AutomapRule {
        height: number;
        input: Record<string, ArrayLike<number>>;
        name?: string;
        outputs: Record<string, ArrayLike<number>>[];
        topology?: "square" | "hex";
        width: number;
    }
    Index
    height: number
    input: Record<string, ArrayLike<number>>

    layer name to pattern cells, row-major - all have to match at an origin for the rule to fire

    name?: string

    only used to name the rule in errors

    outputs: Record<string, ArrayLike<number>>[]

    Possible replacements, each a layer name to replacement cells. One variant is picked per match, so several numbered outputs are random variation and one is a plain deterministic write.

    topology?: "square" | "hex"

    defaults to the target's topology; hex patterns use the same odd-q x/y addresses as Level

    width: number

    the pattern size, in cells; every input and output grid must hold exactly this many