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).
Tell whether a component is registered to the entity.
Iterate over the components registered to the entity. It calls the accessor delegate that has been set to each component.
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.