Esempio n. 1
0
  /**
   * 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);
    }
  }
Esempio n. 2
0
 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++;
 }
Esempio n. 3
0
 public void addAll(ObjectSet<T> set) {
   ensureCapacity(set.size);
   for (T key : set) add(key);
 }
Esempio n. 4
0
 public void addAll(T[] array, int offset, int length) {
   ensureCapacity(length);
   for (int i = offset, n = i + length; i < n; i++) add(array[i]);
 }
Esempio n. 5
0
 // 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);
 }
Esempio n. 6
0
 /**
  * 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);
 }
Esempio n. 7
0
 /**
  * (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);
 }
Esempio n. 8
0
 /**
  * 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);
 }
Esempio n. 9
0
 /**
  * Adds a entity to this world.
  *
  * @param e entity
  */
 public void addEntity(Entity e) {
   added.add(e);
 }