Skip to main content

Class: LifetimeTrackingSystem

Defined in: lifecycle/systems/lifetime-tracking-system.ts:10

System that tracks entity lifetime and updates the hasExpired flag. This system only updates the elapsed time and expiration status - it does not remove entities. Removal or other lifecycle actions are handled by separate strategy-specific systems.

Extends

Constructors

Constructor

new LifetimeTrackingSystem(world): LifetimeTrackingSystem

Defined in: lifecycle/systems/lifetime-tracking-system.ts:17

Creates an instance of LifetimeTrackingSystem.

Parameters

world

World

The World instance.

Returns

LifetimeTrackingSystem

Overrides

System.constructor

Properties

isEnabled

isEnabled: boolean = true

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

Indicates whether the system is enabled.

Inherited from

System.isEnabled


name

name: string

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

The name of the system.

Inherited from

System.name


query

query: Query

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

The components that this system operates on.

Inherited from

System.query

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.

Inherited from

System.beforeAll


run()

run(entity): void

Defined in: lifecycle/systems/lifetime-tracking-system.ts:26

Updates the elapsed time for an entity and sets the hasExpired flag if needed.

Parameters

entity

Entity

The entity to update.

Returns

void

Overrides

System.run


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

Inherited from

System.runSystem


stop()

stop(): void

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

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

Returns

void

Inherited from

System.stop