public static BitSet toBitSet(IntBag bag, BitSet out) { int[] data = bag.getData(); for (int i = 0, s = bag.size(); s > i; i++) { out.set(data[i]); } return out; } }
/** * Removes all components from deleted entities. * * @param pendingPurge * the entities to remove components from */ void clean(IntBag pendingPurge) { int[] ids = pendingPurge.getData(); for (int i = 0, s = pendingPurge.size(); s > i; i++) { removeComponents(ids[i]); } }
@Override public void inserted(IntBag entities) { int[] ids = entities.getData(); for (int i = 0, s = entities.size(); s > i; i++) { insert(ids[i]); } }
@Override public void inserted(IntBag entities) { int[] ids = entities.getData(); for (int i = 0, s = entities.size(); s > i; i++) { insert(ids[i]); } }
@Override public void inserted(IntBag entities) { int[] ids = entities.getData(); for (int i = 0, s = entities.size(); s > i; i++) { inserted(ids[i]); } }
/** * Removes all components from deleted entities. * * @param pendingPurge * the entities to remove components from */ void clean(IntBag pendingPurge) { int[] ids = pendingPurge.getData(); for (int i = 0, s = pendingPurge.size(); s > i; i++) { removeComponents(ids[i]); } }
public static BitVector toBitVector(IntBag bag, BitVector out) { int[] data = bag.getData(); for (int i = 0, s = bag.size(); s > i; i++) { out.set(data[i]); } return out; }
void deleted(IntBag entities) { int[] ids = entities.getData(); for (int i = 0, s = entities.size(); s > i; i++) { int id = ids[i]; if (registered.get(id)) { String removedTag = tagsByEntity.remove(world.getEntity(id)); entitiesByTag.remove(removedTag); registered.clear(id); } } }
void deleted(IntBag entities) { int[] ids = entities.getData(); for (int i = 0, s = entities.size(); s > i; i++) { int id = ids[i]; if (registered.get(id)) { String removedTag = tagsByEntity.remove(world.getEntity(id)); entitiesByTag.remove(removedTag); registered.clear(id); } } }
private void deleted(IntBag entities) { int[] ids = entities.getData(); for (int i = 0, s = entities.size(); s > i; i++) { int id = ids[i]; if (activeEntityIds.unsafeGet(id)) remove(id); } }
/** @inheritDoc */ @Override protected final void processSystem() { IntBag actives = subscription.getEntities(); int[] ids = actives.getData(); for (int i = 0, s = actives.size(); s > i; i++) { process(ids[i]); } } }
private void deleted(IntBag entities) { // performance hack, skip if manager lacks implementation of removed. if ((methodFlags & FLAG_REMOVED) == 0) return; int[] ids = entities.getData(); for (int i = 0, s = entities.size(); s > i; i++) { deleted(world.getEntity(ids[i])); } }
private void deletedAll(IntBag entities) { int[] ids = entities.getData(); for (int i = 0, s = entities.size(); s > i; i++) { int id = ids[i]; activeEntityIds.unsafeClear(id); removedIds.unsafeSet(id); } }
private void added(IntBag entities) { // performance hack, skip if manager lacks implementation of inserted. if ((methodFlags & FLAG_INSERTED) == 0) return; int[] ids = entities.getData(); for (int i = 0, s = entities.size(); s > i; i++) { added(world.getEntity(ids[i])); } }
void deleted(IntBag entities) { int[] ids = entities.getData(); for (int i = 0, s = entities.size(); s > i; i++) { removeFromAllGroups(world.getEntity(ids[i])); } } }
@Override protected void processSystem() { IntBag entities = subscription.getEntities(); int[] ids = entities.getData(); for (int i = 0, s = entities.size(); s > i; i++) { process(ids[i]); } } }
protected void process() { if (CHECK_SOURCE_AND_TARGETS != policy) return; IntBag entities = subscription.getEntities(); int[] ids = entities.getData(); for (int i = 0, s = entities.size(); s > i; i++) { check(ids[i]); } } }
void clean(IntBag pendingDeletion) { int[] ids = pendingDeletion.getData(); for(int i = 0, s = pendingDeletion.size(); s > i; i++) { int id = ids[i]; // usually never happens but: // this happens when an entity is deleted before // it is added to the world, ie; created and deleted // before World#process has been called if (!recycled.unsafeGet(id)) { free(id); } } }
void configureWith(int count) { poolIndex = 0; pool.setSize(0); pool.ensureCapacity(count); for (int i = 0; i < count; i++) { pool.add(world.create(archetype)); } Arrays.sort(pool.getData(), 0, pool.size()); }
protected void inspectComponentTypes(SaveFileFormat save) { ComponentManager cm = world.getComponentManager(); int[] ids = save.entities.getData(); for (int i = 0, s = save.entities.size(); s > i; i++) componentIds.or(cm.componentBits(ids[i])); } }