Get a component pointer of the entity.
Set the value of a component of the entity.
Destroy the entity (unregister all attached components).
Returns the id of the entity.
Invalidate the entity instance (but does not destroy it).
Set the value of a component of the entity.
Compare two entities and tells whether they are the same (same id).
Register a component C to an entity.
Returns a string representation of an entity.
Unregister a component C from an entity.
Tells whether the entity is valid.
@component struct Position { float x, y; } auto em = new EntityManager(new EventManager); auto entity = em.create(); auto posCompPtr = entity.register!Position(2.0, 3.0); assert(posCompPtr == entity.component!Position); assert(posCompPtr.x == 2.0); assert(entity.component!Position.y == 3.0);
Entity structure.
This is the combination of two 32-bits id: a unique-id and a version-id.