/** * Remove all GameObject instances of given class type. * * @param type De class type of the instances to be removed */ public <T> void deleteAllGameObjectsOfType(Class<T> type) { for (int i = 0; i < items.size(); i++) { GameObject go = items.get(i); if (go.getClass() == type) { go.clearActive(); } } }
/** * * Delete a GameObject from the game. * * @param gameObject The GameObject instance to be removed */ public final void deleteGameObject(GameObject gameObject) { gameObject.clearActive(); }