Skip to content

Class: EntityManager

EntityManager keeps tracks of all entities and their components/changes in their components. The EntityManager watches for changes in which components belong to an entity (add/remove), and when a change is detected it will broadcast that a change has been detected in the entity and the entity's new list of components. The EntityManager also watches for entities being deleted and removes the deleted entity's components.

Hierarchy

Table of contents

Constructors

Properties

Methods

Constructors

constructor

+ new EntityManager(messageBus: IMessageBus, componentManagers?: ComponentManager[], subscriberID?: number): EntityManager

Parameters:

Name Type
messageBus IMessageBus
componentManagers ComponentManager[]
subscriberID? number

Returns: EntityManager

Inherited from: Subscriber

Properties

subscriberID

subscriberID: number

Inherited from: Subscriber.subscriberID

Methods

OnMessage

OnMessage(message: IMessage): void

Parameters:

Name Type
message IMessage

Returns: void

Overrides: Subscriber