Show:
Module: ecs

Constructor

ECS ()

Methods

addEntity
(
  • entity
)

Add an entity to the ecs.

Parameters:

  • entity Entity

    The entity to add.

addSystem
(
  • system
)

Add a system to the ecs.

Parameters:

cleanDirtyEntities ()
private

"Clean" entities flagged as dirty by removing unecessary systems and adding missing systems.

removeEntity
(
  • entity
)
Entity

Remove an entity from the ecs by reference.

Parameters:

  • entity Entity

    reference of the entity to remove

Returns:

Entity:

the remove entity if any

removeEntityById
(
  • entityId
)
Entity

Remove an entity from the ecs by entity id.

Parameters:

  • entityId Entity

    id of the entity to remove

Returns:

Entity:

removed entity if any

removeEntityIfDirty
(
  • entity
)
private

Remove an entity from dirty entities by reference.

Parameters:

  • entity type

    entity to remove

removeSystem
(
  • system
)

Remove a system from the ecs.

Parameters:

  • system System

    system reference

update ()

Update the ecs.

Properties

entities

Array

Store all entities of the ECS.

entitiesSystemsDirty

Array

Store entities which need to be tested at beginning of next tick.

systems

Array

Store all systems of the ECS.

updateCounter

Number

Count how many updates have been done.