TickRunner
Defined in: src/tick-runner.ts:75
Drives the per-tick ceremony in response to a TickSource. Consolidates
the sequence that every per-tick consumer would otherwise hand-roll:
ctx = contextFactory(info)scheduler.run(ctx)onBeforeFlush?.(ctx, info)— emit tick-boundary events heregetEvents?.(ctx).flush()— skipped when there is no event busworld.flushCommands()world.lifecycle.flush()onTickComplete?.(ctx, info)
A tick is an atomic simulation step: one world from build-to-flush. Consumers that need a world swap (level transition, scene change, restart) queue the swap from inside a system and perform it between ticks — never mid-tick.
The runner is deliberately narrow — it knows nothing about turn
numbers, input actions, rendering, or game state. Those are consumer
concerns and live in contextFactory, onBeforeFlush, and
onTickComplete.
Type Parameters
Section titled “Type Parameters”TCtx
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new TickRunner<
TCtx>(opts):TickRunner<TCtx>
Defined in: src/tick-runner.ts:79
Parameters
Section titled “Parameters”TickRunnerOptions<TCtx>
Returns
Section titled “Returns”TickRunner<TCtx>
Methods
Section titled “Methods”start()
Section titled “start()”start():
void
Defined in: src/tick-runner.ts:99
Returns
Section titled “Returns”void
stop()
Section titled “stop()”stop():
void
Defined in: src/tick-runner.ts:106
Returns
Section titled “Returns”void