/** * Delete the entity from the world. * * @param e Entity to remove */ public void deleteEntity(Entity e) { if (!deleted.contains(e)) { deleted.add(e); } if (added.contains(e)) { added.remove(e); } }
private void addStash(T key) { if (stashSize == stashCapacity) { // Too many pushes occurred and the stash is full, increase the table size. resize(capacity << 1); add(key); return; } // Store key in the stash. int index = capacity + stashSize; keyTable[index] = key; stashSize++; size++; }
public void addAll(ObjectSet<T> set) { ensureCapacity(set.size); for (T key : set) add(key); }
public void addAll(T[] array, int offset, int length) { ensureCapacity(length); for (int i = offset, n = i + length; i < n; i++) add(array[i]); }
// Destroy bodies from Poolable or Non-Poolable objects public static void destroyBody(Body body) { // body.setActive(false); //Body wont be active while it waits deletion; //Da problema!! removableBodies.add(body); }
/** * Disable the entity from being processed. Won't delete it, it will continue to exist but won't * get processed. * * @param e entity to disable */ public void disable(Entity e) { disable.add(e); }
/** * (Re)enable the entity in the world, after it having being disabled. Won't do anything unless it * was already disabled. * * @param e entity to enable */ public void enable(Entity e) { enable.add(e); }
/** * Ensure all systems are notified of changes to this entity. If you're adding a component to an * entity after it's been added to the world, then you need to invoke this method. * * @param e entity */ public void changedEntity(Entity e) { changed.add(e); }
/** * Adds a entity to this world. * * @param e entity */ public void addEntity(Entity e) { added.add(e); }