mwg API
    Preparing search index...

    Interface WeightedFloodOptions<T, K>

    interface WeightedFloodOptions<T, K> {
        canEnter?: (cell: T, from: T, cost: number) => boolean;
        cost: (from: T, to: T) => number;
        key: (cell: T) => K;
        maxCost: number;
        neighbors: (cell: T) => Iterable<T>;
        stop?: (cell: T, cost: number) => boolean;
    }

    Type Parameters

    • T
    • K
    Index
    canEnter?: (cell: T, from: T, cost: number) => boolean

    Optional game rule that rejects a candidate before it is reached.

    cost: (from: T, to: T) => number

    Cost of entering to from from; non-finite or negative costs are ignored.

    key: (cell: T) => K

    Stable identity for a cell; it may be a string, number, or object key.

    maxCost: number

    Maximum accumulated cost, inclusive.

    neighbors: (cell: T) => Iterable<T>

    Adjacent cells, in whatever topology the game uses.

    stop?: (cell: T, cost: number) => boolean

    Optional game rule that keeps a reached cell from expanding further.