List of usage examples for com.badlogic.gdx.utils Pool freeAll
public void freeAll(Array<T> objects)
From source file:com.badlydrawngames.general.Pools.java
License:Apache License
/** Frees the items in an array to a pool. * @param <T> the type of item allocated in the array. * @param array the array of items to free. * @param pool the pool that the items are to be released to. */ public static <T> void freeArrayToPool(Array<T> array, Pool<T> pool) { pool.freeAll(array); array.clear();//from ww w .j a va2 s .c o m }
From source file:io.piotrjastrzebski.sfg.utils.PoolUtils.java
License:Open Source License
/** * free and clear all objects// w ww . j a v a 2s . co m */ public static <T extends Pool.Poolable> void dispose(Class<T> classToDispose, Array<T> toDispose) { Pool<T> pool = Pools.get(classToDispose); if (toDispose != null) pool.freeAll(toDispose); pool.clear(); }