예제 #1
0
 /**
  * Remove an object from the world.
  *
  * @param object the object to remove
  */
 public synchronized void removeObject(Actor object) {
   if (objects.remove(object)) {
     // we only want to remove it once.
     collisionChecker.removeObject(object);
   }
   object.setWorld(null);
 }
예제 #2
0
파일: World.java 프로젝트: rma93/greenfoot
  /**
   * Remove an object from the world.
   *
   * @param object the object to remove
   */
  public void removeObject(Actor object) {
    if (object == null || object.world != this) {
      return;
    }

    objectsDisordered.remove(object);
    collisionChecker.removeObject(object);
    if (objectsDisordered != objectsInActOrder && objectsInActOrder != null) {
      objectsInActOrder.remove(object);
    } else if (objectsDisordered != objectsInPaintOrder && objectsInPaintOrder != null) {
      objectsInPaintOrder.remove(object);
    }
    object.setWorld(null);
  }