hex-world
    Preparing search index...

    Function createRiverCellFilter

    • Builds the predicate deciding whether a given cell's river channel is drawn by THIS liquid: it must carry a river, must not itself be a liquid cell, and its chain must drain into this liquid (unclassified chains go to whichever liquid owns them — see ownsUnclassifiedRivers).

      buildRiverGeometry and findWaterfalls share it so a waterfall's spray and plunge pool are emitted by exactly the liquid that renders the channel feeding it — never twice, never by the wrong liquid.

      When opts.riverCells is supplied (ChunkManager's map-wide ownership cache) this is a set lookup; otherwise it falls back to tracing the outgoing chain, memoised across the whole call so a shared downstream reach is walked once.

      Parameters

      Returns (col: number, row: number) => boolean