Scheduler beta
Class of @v12-engine/engine
export declare class SchedulerRuns the systems of a world in their order, each as often as it asks. The order is worked out whenever a system is added or taken out: by phase first, then by what each says it comes before or after, then in the order they were added. Measures each one while profiling is on, for the stats panel.
Members
constructor
constructor(systems: System[]);Constructs a new instance of the Scheduler class
add
add(system: System): void;Adds a system to a world that is already running, like a computer player
disable
disable(name: string): void;Switches a system off: it no longer runs, and stays off when others are added
profiling
profiling: boolean;Whether to time each system. Costs two clock readings per system per tick, so it is off unless someone looks
remove
remove(name: string): boolean;Takes a system out by name. False when there is none of that name
run
run(world: World): void;Runs one tick of every system that is due. Each is given the time since it last ran
systems
get systems(): readonly System[];The systems, in the order they run
timing
timing(): SystemTiming[];What each system takes, in the order they run. Empty until profiling has been on for a while