MCPcopy Create free account
hub / github.com/YGYOOO/WorldX / releaseUpTo

Method releaseUpTo

client/src/systems/EventQueue.ts:18–33  ·  view source on GitHub ↗
(day: number, tick: number)

Source from the content-addressed store, hash-verified

16 }
17
18 releaseUpTo(day: number, tick: number): SimulationEvent[] {
19 const toRelease: SimulationEvent[] = [];
20 const remaining: SimulationEvent[] = [];
21
22 for (const e of this.buffer) {
23 if (e.gameDay < day || (e.gameDay === day && e.gameTick <= tick)) {
24 toRelease.push(e);
25 this.emittedIds.add(e.id);
26 } else {
27 remaining.push(e);
28 }
29 }
30
31 this.buffer = remaining;
32 return toRelease;
33 }
34
35 get length(): number {
36 return this.buffer.length;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected