mwg API
    Preparing search index...

    Interface TerrainRule

    One [terrain_graphics]-style transition rule: a set of neighbour conditions that must all hold, and the image or images to draw when they do. A rule with more conditions is more specific and wins over a less specific one covering the same cell, the same precedence a hand-authored rule set expects (a "this exact corner" rule beats a "any edge" rule); among rules tied on specificity, probability weights which one is picked, so a terrain can vary its look without every variant needing a different neighbourhood to key off of.

    interface TerrainRule {
        conditions: readonly TerrainCondition[];
        id: string;
        images: readonly TerrainImage[];
        probability?: number;
        rotations?: number;
    }
    Index
    conditions: readonly TerrainCondition[]
    id: string
    images: readonly TerrainImage[]
    probability?: number

    relative weight among rules tied for most-specific at a cell; default 1

    rotations?: number

    how many rotated copies of this rule to also try, each one conditions/images rotated by one more step of rotate (see squareRotate/hexRotate) - so one rule authored for one direction covers every direction a symmetric transition needs, instead of one rule per direction written out by hand. 0 or omitted tries only the rule as written.