Method SetCapacity
- Namespace
- Gamelogic.Extensions
- Assembly
- Gamelogic.Extensions.dll
SetCapacity<T>(IPool<T>, int, bool)
Sets the capacity of the pool. If the new capacity is less than the current capacity, the pool will be reduced to the new capacity by destroying objects. If the new capacity is greater than the current capacity, new objects will be created to fill the pool.
public static void SetCapacity<T>(this IPool<T> pool, int newCapacity, bool deactivateFirst = false)
Parameters
pool
IPool<T>The pool to set the capacity of.
newCapacity
intThe new capacity.
deactivateFirst
boolWhether to deactivate the object before destroying them.
Type Parameters
T
The type of the objects in the pool.