EntityManager

Manages entities creation and component memory management.

Constructors

this
this(EventManager eventManager, size_t maxComponent, size_t poolSize)

Constructor of the entity-manager.

Members

Aliases

CompAccessor
alias CompAccessor = void delegate(Entity e, void* pc)
Undocumented in source.

Functions

accessor
void accessor(void delegate(Entity e, C* pc) dg)

Set an accessor delegate for a component.

accessor
void delegate(Entity e, C* pc) accessor()

Get the accessor delegate assigned to a component.

capacity
size_t capacity()

Current capacity entity.

components
auto components()

Return a range of all the valid instances of a component.

create
Entity create()

Create an entity.

entitiesWith
auto entitiesWith()

Allows to browse through the entities that have a required set of components.

getEntity
Entity getEntity(Entity.Id id)

Returns an entity from an an entity-id

opApply
int opApply(int delegate(Entity entity) dg)

Allows to browse through all the valid entities of the manager with a foreach loop.

size
size_t size()

Current number of managed entities.

valid
bool valid(Entity.Id id)

Return true if the given entity ID is still valid.

Meta