Skip to content

API Function system

github-actions[bot] edited this page Dec 3, 2026 · 1 revision

Function: system()

function system(id, options?): <T>(value, context) => void;

Defined in: src/engine/core/systemDecorators.ts:63

Class decorator: register a system under a stable id (ADR 0679), as @behavior does for components. The engine makes one instance per World it runs in. Decorator order doesn't matter: registration waits until every decorator on the class has run.

@system("game.Steering")
@updateInGroup(SimulationSystemGroup)
export class SteeringSystem implements ISystem {
  private ships!: Query;
  onCreate(state: SystemState) { this.ships = state.query(Transform, Ship); }
  onUpdate(state: SystemState) { for (const ship of this.ships) { … } }
}

Parameters

id

string

options?

SystemOptions = {}

Returns

<T>(value, context) => void

Clone this wiki locally