Development
Ecstatic provides a few utilities to aid in development.
entity.toDevEntity()
#
For performance reasons, Estatic stores data internally a little...differently. This can make it challanging to get an entity's specific data. Because of this, the entity.toDevEntity()
method exists.
entity.toDevEntity
returns:
- The entity's instance id.
- All the components that are currently attached to the entity, given in a decently readable manor.
- A list of all Systems that will be called on. Very helpful to verify that your entity will be called in a System.
- Any tags that have been added to the entity.
world.dev.entities
#
Sometimes you just want to see all the entities currently active in the world. To do this, simply inspect world.dev.entities
. This returns an array of all current entities, each serialized into a DevEntity
.
world.dev.systemComponents()
#
world.dev.systemComponents
is used to retreive a list of all systems, and the components that each system requires.
PRO-TIP: use with console.table
: console.table(world.dev.systemComponents)