Ejemplo n.º 1
0
  /** 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();
      }
    }
  }
Ejemplo n.º 2
0
  @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;
    }
  }
Ejemplo n.º 3
0
 /**
  * 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);
 }
Ejemplo n.º 4
0
 /**
  * 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();
 }