Package gaiasky.util
Class MyPools
java.lang.Object
gaiasky.util.MyPools
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidFrees an object from thepool.static voidfreeAll(com.badlogic.gdx.utils.Array objects)Frees the specified objects from thepool.static voidfreeAll(com.badlogic.gdx.utils.Array objects, boolean samePool)Frees the specified objects from thepool.static <T> com.badlogic.gdx.utils.Pool<T>Returns a new or existing pool for the specified type, stored in a Class toPoolmap.static <T> com.badlogic.gdx.utils.Pool<T>Returns a new or existing pool for the specified type, stored in a Class toPoolmap.static <T> TObtains an object from thepool.static <T> voidSets an existing pool for the specified type, stored in a Class toPoolmap.
-
Method Details
-
get
Returns a new or existing pool for the specified type, stored in a Class toPoolmap. Note the max size is ignored if this is not the first time this pool has been requested. -
get
Returns a new or existing pool for the specified type, stored in a Class toPoolmap. -
set
Sets an existing pool for the specified type, stored in a Class toPoolmap. -
obtain
Obtains an object from thepool. -
free
Frees an object from thepool. -
freeAll
public static void freeAll(com.badlogic.gdx.utils.Array objects)Frees the specified objects from thepool. Null objects within the array are silently ignored. Objects don't need to be from the same pool. -
freeAll
public static void freeAll(com.badlogic.gdx.utils.Array objects, boolean samePool)Frees the specified objects from thepool. Null objects within the array are silently ignored.- Parameters:
samePool- If true, objects don't need to be from the same pool but the pool must be looked up for each object.
-