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.
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new SystemScheduler():
SystemScheduler
Returns
Section titled “Returns”SystemScheduler
Accessors
Section titled “Accessors”currentPhase
Section titled “currentPhase”Get Signature
Section titled “Get Signature”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.
Returns
Section titled “Returns”Phase | null
fixedStepIndex
Section titled “fixedStepIndex”Get Signature
Section titled “Get Signature”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.
Returns
Section titled “Returns”number
Methods
Section titled “Methods”_destroy()
Section titled “_destroy()”_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.
Returns
Section titled “Returns”void
_start()
Section titled “_start()”_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.
Parameters
Section titled “Parameters”context
Section titled “context”Returns
Section titled “Returns”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.
Parameters
Section titled “Parameters”system
Section titled “system”Returns
Section titled “Returns”void
getAllSystems()
Section titled “getAllSystems()”getAllSystems():
System[]
Defined in: SystemScheduler.ts:128
Get all systems across all phases.
Returns
Section titled “Returns”System[]
getSystems()
Section titled “getSystems()”getSystems(
phase): readonlySystem[]
Defined in: SystemScheduler.ts:123
Get all systems registered for a phase.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”readonly System[]
remove()
Section titled “remove()”remove(
system):void
Defined in: SystemScheduler.ts:92
Remove a system, calling its onUnregister if it was registered.
Parameters
Section titled “Parameters”system
Section titled “system”Returns
Section titled “Returns”void
run(
phase,dt):void
Defined in: SystemScheduler.ts:104
Run all enabled systems in a given phase. Wraps each in ErrorBoundary if available.
Parameters
Section titled “Parameters”number
Returns
Section titled “Returns”void
setErrorBoundary()
Section titled “setErrorBoundary()”setErrorBoundary(
boundary):void
Defined in: SystemScheduler.ts:41
Set the error boundary for wrapping system execution.
Parameters
Section titled “Parameters”boundary
Section titled “boundary”Returns
Section titled “Returns”void