Skip to content
HerrDerb edited this page Mar 20, 2018 · 50 revisions

Entities are containers of related components.

Create entity

int e = world.create();

In artemis-odb, entities are represented by an int for performance reasons. For convenience, Entity class is also supported.

Delete entity

world.delete(e);

Events for created, altered or removed entities are postponed until the system is done processing. This removes the need for systems to defend their subscription lists and allows for cleaner code and better performance.

Querying for entities

Systems have built in mechanisms for finding entities which have a specified set of components (see also, Aspects.)

Outside of systems, or if multiple different types of entities need to be queried within a system, you may be interested in AspectSubscriptionManager, which gives the ability to query arbitrary kinds of entities at will, and also listen to changes in them.

Change composition

See Components

Predefine entities

See Archetypes

Clone this wiki locally