Class: EntityManager

EntityManager

new EntityManager()

Manage, create, and destroy entities. Can use methods to mutate entities (tags, components) directly or via the facade on the Entity.
Source:

Members

_entities :Array.<Entity>

Type:
Source:

_groups :Array.<Group>

Type:
Source:

Methods

count() → {Number}

Source:
Returns:
Total number of entities.
Type
Number

createEntity() → {Entity}

Get a new entity.
Source:
Returns:
Type
Entity

entityAddComponent(entity, Component)

Parameters:
Name Type Description
entity Entity
Component function
Source:

entityAddTag(entity, tag)

Parameters:
Name Type Description
entity Entity
tag String
Source:

entityRemoveComponent(entity, Component)

Parameters:
Name Type Description
entity Entity
Component function
Source:

entityRemoveTag(entity, tag)

Parameters:
Name Type Description
entity Entity
tag String
Source:

poolStats() → {Object}

Get information about the object pools of the entities and the various components.
Source:
Returns:
Type
Object

queryComponents(Components) → {Array.<Entity>}

Parameters:
Name Type Description
Components Array.<function()>
Source:
Returns:
Type
Array.<Entity>

queryTag(tag) → {Array.<Entity>}

Parameters:
Name Type Description
tag String
Source:
Returns:
Type
Array.<Entity>

removeEntitiesByTag(tag)

Parameters:
Name Type Description
tag String
Source:

removeEntity(entity)

Parameters:
Name Type Description
entity Entity
Source: