/** Process all non-passive systems. */ public void process() { check(added, addedPerformer); check(changed, changedPerformer); check(disable, disablePerformer); check(enable, enablePerformer); check(deleted, deletedPerformer); cm.clean(); em.clean(); if (eventSystem != null) { eventSystem.update(); } for (int i = 0; i < systems.size; i++) { EntitySystem system = systems.get(i); if (!system.isPassive()) { system.process(); } } }
@Override public void dispose() { em.dispose(); cm.dispose(); added.clear(); changed.clear(); deleted.clear(); enable.clear(); disable.clear(); for (Manager manager : managers) { manager.dispose(); } managers.clear(); systems.clear(); if (eventSystem != null) { eventSystem.dispose(); eventSystem = null; } }
/** * Get a entity having the specified id. * * @param entityId id of the entity to retrieve. * @return entity Entity or null. */ public Entity getEntity(int entityId) { return em.getEntity(entityId); }
/** * Create and return a new or reused entity instance. Will NOT add the entity to the world, use * World.addEntity(Entity) for that. * * @return created entity */ public Entity createEntity() { return em.createEntityInstance(); }