export type CombatClock = () => number; let activeCombatClock: CombatClock = () => Date.now(); /** Shared simulation time. Production uses wall time; deterministic tools inject a fixed-step clock. */ export function combatNow(): number { return activeCombatClock(); } /** * Replaces the combat clock and returns a disposer that restores the previous * source. Benchmark callers must run sequentially because combat stores are * process-wide singletons. */ export function installCombatClock(clock: CombatClock): () => void { const previous = activeCombatClock; activeCombatClock = clock; return () => { activeCombatClock = previous; }; }