Skip to content

SystemScheduler

Defined in: SystemScheduler.ts:12

Manages ordered execution of systems within each phase, and owns the registration lifecycle: once started, a system added here receives the engine context and its onRegister immediately, and remove calls onUnregister.

new SystemScheduler(): SystemScheduler

SystemScheduler

get currentPhase(): Phase | null

Defined in: SystemScheduler.ts:26

Phase whose systems are executing right now, or null outside any phase. Lets code reachable from several phases (input queries, shared helpers) resolve behavior against its calling context instead of assuming one.

Phase | null


get fixedStepIndex(): number

Defined in: SystemScheduler.ts:36

Monotonic count of fixed steps started. During Phase.FixedUpdate it identifies the running step — a frame can run several steps, or none — and between steps it holds the last started step’s number. 0 before the first step.

number

_destroy(): void

Defined in: SystemScheduler.ts:65

Internal

Unregister all registered systems (in reverse, for clean teardown) and detach the context. Called by Engine on destroy. Owns only the registration lifecycle — phase-list membership stays with whoever added the system.

void


_start(context): void

Defined in: SystemScheduler.ts:51

Internal

Attach the engine context and register every system added so far. Called by Engine at startup; systems added afterwards are registered directly by add.

EngineContext

void


add(system): void

Defined in: SystemScheduler.ts:80

Add a system. Sorted by priority within its phase. On a started engine the system receives the context and its onRegister immediately.

System

void


getAllSystems(): System[]

Defined in: SystemScheduler.ts:128

Get all systems across all phases.

System[]


getSystems(phase): readonly System[]

Defined in: SystemScheduler.ts:123

Get all systems registered for a phase.

Phase

readonly System[]


remove(system): void

Defined in: SystemScheduler.ts:92

Remove a system, calling its onUnregister if it was registered.

System

void


run(phase, dt): void

Defined in: SystemScheduler.ts:104

Run all enabled systems in a given phase. Wraps each in ErrorBoundary if available.

Phase

number

void


setErrorBoundary(boundary): void

Defined in: SystemScheduler.ts:41

Set the error boundary for wrapping system execution.

ErrorBoundary

void