• Seed an sohl.entity.random.Rng for the duration of a driven tour and return the RngLease that restores it.

    The pre-seed state is snapshotted before the seed is applied, so RngLease.restore rewinds to the precise stream position the game was at — not a fresh entropy seed — leaving no observable perturbation once the tour ends. This is deliberately a lease: the restore closure is created at the same moment as the seed so the caller can register it as a finally-style hook that cannot be skipped.

    Parameters

    • rng: Rng

      The generator to seed (typically the sohl.random singleton).

    • seed: string | number | number[]

      The seed applied for the tour — a string, a number, or state words.

    Returns RngLease

    A fire-once RngLease whose restore() returns rng to normal.