Skip to main content

Class: LifetimeComponent

Defined in: lifecycle/components/lifetime-component.ts:7

Component that tracks the elapsed time and duration of an entity's lifetime. This is a pure data component with no logic.

Extends

Constructors

Constructor

new LifetimeComponent(durationSeconds): LifetimeComponent

Defined in: lifecycle/components/lifetime-component.ts:16

Creates an instance of the LifetimeComponent.

Parameters

durationSeconds

number

The total duration of the entity's lifetime in seconds.

Returns

LifetimeComponent

Overrides

Component.constructor

Properties

durationSeconds

durationSeconds: number

Defined in: lifecycle/components/lifetime-component.ts:9


elapsedSeconds

elapsedSeconds: number

Defined in: lifecycle/components/lifetime-component.ts:8


hasExpired

hasExpired: boolean

Defined in: lifecycle/components/lifetime-component.ts:10

Accessors

id

Get Signature

get static id(): symbol

Defined in: ecs/types/Component.ts:12

The unique id of the component.

Returns

symbol

Inherited from

Component.id

Methods

reset()

reset(durationSeconds): void

Defined in: lifecycle/components/lifetime-component.ts:24

Parameters

durationSeconds

number = ...

Returns

void