Skip to content

@web-engine-dev/scheduler


@web-engine-dev/scheduler / SystemBuilder

Interface: SystemBuilder<TContext>

Builder for creating system descriptors with fluent API.

Provides a chainable interface for configuring system metadata. Methods can be called in any order.

Example

typescript
const system = defineSystem<GameContext>('ai', updateAI)
  .inStage(CoreStages.UPDATE)
  .after('input', 'physics')
  .before('render')
  .label('enemy', 'behavior')
  .parallel()
  .runIf((ctx) => !ctx.isPaused)
  .build();

scheduler.addSystem(system);

Type Parameters

TContext

TContext = unknown

Methods

after()

after(...systems): SystemBuilder<TContext>

Run after specified systems.

Parameters

systems

...SystemId[]

Returns

SystemBuilder<TContext>


before()

before(...systems): SystemBuilder<TContext>

Run before specified systems.

Parameters

systems

...SystemId[]

Returns

SystemBuilder<TContext>


build()

build(): SystemDescriptor<TContext>

Build the system descriptor.

Returns

SystemDescriptor<TContext>


inStage()

inStage(stage): SystemBuilder<TContext>

Set the stage for this system.

Parameters

stage

string

Returns

SystemBuilder<TContext>


label()

label(...labels): SystemBuilder<TContext>

Add labels to this system.

Parameters

labels

...string[]

Returns

SystemBuilder<TContext>


parallel()

parallel(): SystemBuilder<TContext>

Mark this system as parallelizable.

Returns

SystemBuilder<TContext>


runIf()

runIf(condition): SystemBuilder<TContext>

Add a run condition for conditional execution.

Parameters

condition

RunCondition<TContext>

Returns

SystemBuilder<TContext>

Proprietary software. All rights reserved.