/** * Returns a reference to the bag holding all matched entities. * * <p><b>Warning: </b> Never remove elements from the bag, as this * will lead to undefined behavior.</p> * * @return View of all active entities. */ public IntBag getEntities() { if (entities.isEmpty() && !activeEntityIds.isEmpty()) rebuildCompressedActives(); return entities; }
/** * Returns a reference to the bag holding all matched entities. * * <p><b>Warning: </b> Never remove elements from the bag, as this * will lead to undefined behavior.</p> * * @return View of all active entities. */ public IntBag getEntities() { if (entities.isEmpty() && !activeEntityIds.isEmpty()) rebuildCompressedActives(); return entities; }
/** * Synchronizes new subscriptions with {@link World} state. * * @param es entity subscription to update. */ void synchronize(EntitySubscription es) { Bag<BitVector> compositionBits = identityResolver.compositionBits; for (int i = 1, s = compositionBits.size(); s > i; i++) { BitVector componentBits = compositionBits.get(i); es.processComponentIdentity(i, componentBits); } for (Entity e : world.getEntityManager().entities) { if (e != null) es.check(e.id, getIdentity(e.id)); } es.informEntityChanges(); es.rebuildCompressedActives(); }
/** * Synchronizes new subscriptions with {@link World} state. * * @param es entity subscription to update. */ void synchronize(EntitySubscription es) { Bag<BitVector> compositionBits = identityResolver.compositionBits; for (int i = 1, s = compositionBits.size(); s > i; i++) { BitVector componentBits = compositionBits.get(i); es.processComponentIdentity(i, componentBits); } for (Entity e : world.getEntityManager().entities) { if (e != null) es.check(e.id, getIdentity(e.id)); } es.informEntityChanges(); es.rebuildCompressedActives(); }
/** * Synchronizes new subscriptions with {@link World} state. * * @param es entity subscription to update. */ void synchronize(EntitySubscription es) { Bag<BitVector> compositionBits = identityResolver.compositionBits; for (int i = 1, s = compositionBits.size(); s > i; i++) { BitVector componentBits = compositionBits.get(i); es.processComponentIdentity(i, componentBits); } for (Entity e : world.getEntityManager().entities) { if (e != null) es.check(e.id, getIdentity(e.id)); } es.informEntityChanges(); es.rebuildCompressedActives(); }