Exemplo n.º 1
0
  /**
   * Removes the entity from the manager, freeing it's id for new entities.
   *
   * @param entityId the entity to remove
   */
  @Override
  public void deleted(int entityId) {
    Entity entity = entities.get(entityId);
    if (entity == null) return;

    entities.set(entityId, null);

    // 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
    newlyCreatedEntityIds.set(entityId, false);

    recyclingEntityFactory.free(entity);

    disabled.clear(entityId);
  }