Class: EntityManager

EntityManager


new EntityManager()

Manage, Create and destroy entities. Can use methods directly or via facade on the Entity.

Author:
  • episanchez

Extends

Members


<static> aspect :Aspect

Aspect of this system

Type:

<static> entities :number

Array of all entities of the world

Type:
  • number

<static> number :number

current last number of entities

Type:
  • number

Methods


begin()

Begin processing of system

Inherited From:

checkProcessing()

Check if the system could be process.

Inherited From:

createEntity()

Create an entity


createEntityWithArchetype(archetype)

Create an entity with its archetype

Parameters:
Name Type Description
archetype Object

Entity Archetype


createEntityWithArchetypeName(name)

Create an entity with its archetype name

Parameters:
Name Type Description
name string

Name of the entity's archetype


disable()

Disable System

Inherited From:

enable()

Enable system

Inherited From:

end()

End Processing of system

Inherited From:

getEnabled()

Give the status boolean of system

Inherited From:
Returns:

IsEnable

Type
boolean

getEntityById(id)

Get an Entity by its id

Parameters:
Name Type Description
id number

Id of the entity


getWorld()

Get the World
return {World}

Inherited From:

initialize()

Initialization of the manager (register it in the aspectSubscriptionManager)

Inherited From:

insert(id)

Insert Subscription listener

Parameters:
Name Type Description
id number

id of the entity inserted

Overrides:

inserted(ids)

Inserted Subscription Listener (call the insert methods for each ids)

Parameters:
Name Type Description
ids Array.<Number>

Array of entity ids

Inherited From:

process()

Processing of system, calls if check processing is true : begin, processSystem, end methods

Inherited From:

<abstract> processSystem()

Process the system
Have to be impemented

Inherited From:

remove(id)

Remove Subscription listener

Parameters:
Name Type Description
id number

id of the entity removed

Overrides:

removed(ids)

Removed Subscription Listener (call the remove methods for each ids)

Parameters:
Name Type Description
ids Array.<Number>

Array of entity ids

Inherited From:

setWorld(world)

Set a world to the system

Parameters:
Name Type Description
world World

-

Inherited From:

synchronize(take)

Synchronize the new subscription

Parameters:
Name Type Description
take object

an EntitySubscription Object