Skip to content
Shaun Reich edited this page Nov 30, 2015 · 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 querying them. Outside of systems, or if multiple different types of entities need to be queried within a system, you may be interested in Aspects are used for systems to state what they are going to operate on, as well as AspectSubscriptionManager, which gives the ability to query arbitrary kinds of entities at will, and also listen to changes in them.

Change composition

See Components

Clone this wiki locally