Skip to main content

Class: abstract System

Defined in: ecs/types/System.ts:10

Represents a system in the Entity-Component-System (ECS) architecture. A system operates on entities that contain specific components. Systems are responsible for updating the state of entities.

Extended by

Implements

Constructors

Constructor

new System(name, query): System

Defined in: ecs/types/System.ts:31

Creates a new System instance.

Parameters

name

string

The name of the system.

query

Query

The components that this system operates on.

Returns

System

Properties

isEnabled

isEnabled: boolean = true

Defined in: ecs/types/System.ts:24

Indicates whether the system is enabled.


name

name: string

Defined in: ecs/types/System.ts:14

The name of the system.


query

query: Query

Defined in: ecs/types/System.ts:19

The components that this system operates on.

Methods

beforeAll()

beforeAll(entities): Entity[]

Defined in: ecs/types/System.ts:70

Hook method that is called before running the system on all entities. Can be overridden by subclasses to modify the entities before processing.

Parameters

entities

Entity[]

The entities to be processed.

Returns

Entity[]

The modified entities.


run()

abstract run(entity): boolean | void

Defined in: ecs/types/System.ts:62

Abstract method to run the system on a single entity. Must be implemented by subclasses.

Parameters

entity

Entity

The entity to run the system on.

Returns

boolean | void

void | boolean - Returns void or a boolean indicating whether to exit early.


runSystem()

runSystem(entities): void

Defined in: ecs/types/System.ts:40

Runs the system on the provided entities.

Parameters

entities

Entity[]

The entities to run the system on.

Returns

void


stop()

stop(): void

Defined in: ecs/types/System.ts:77

Stops the system. This method can be overridden by subclasses.

Returns

void

Implementation of

Stoppable.stop