Entity

An entity an aggregate of components (pure data), accessible with an id.

Constructors

this
this(EntityManager manager, ID id)

Construct an entity with a manager reference and an ID.

Members

Functions

add
void add(C component)

Add a component to the entity.

component
inout(C) component()

Return the component added to this entity.

destroy
void destroy()

Destroy this entity and invalidate all handles to this entity.

hasComponent
bool hasComponent()

Check if the entity has a specific component.

id
inout(ID) id()

Return the entity id.

invalidate
void invalidate()

Invalidate this entity handle (but not other handles).

opCmp
int opCmp(Object o)

Comparison operator.

opEquals
bool opEquals(Object o)

Equals operator (check for equality).

remove
void remove()

Remove the component if the entity has it.

valid
bool valid()

Check if this handle is valid (points to the entity with the same tag).

Meta