forked from phenom/healer-man
Release Healer Man 0.1.9
This commit is contained in:
1 parent
c245a199b6
commit
d060296ade
74 files changed
+5901
-334
No files matched your search
@@ -0,0 +1,21 @@
|
||||
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;
|
||||
};
|
||||
}
|
||||
Reference in new issue
Block a user