mwg API
    Preparing search index...

    Function active

    • The generator the free functions (int, float, chance, ...) draw from.

      This is the handle a SimulationRuntime needs to share the ambient stream: pass the returned object as the runtime's random and both sides draw from (and snapshot) one sequence, so a journal replay reproduces scene draws.

      Returns Random.Generator

      import { Random } from '@datamoc/mwg/core';

      Random.push(12345);
      const shared = Random.active();
      const roll = shared.int(20);
      Random.pop();