Constructor HashPool
- Namespace
- Gamelogic.Extensions
- Assembly
- Gamelogic.Extensions.dll
HashPool(int, Func<T>, Action<T>, Action<T>, Action<T>, IEqualityComparer<T>)
Initializes a new instance of HashPool<T> with the given capacity and callbacks.
public HashPool(int initialCapacity, Func<T> create, Action<T> destroy, Action<T> activate, Action<T> deactivate, IEqualityComparer<T> comparer = null)
Parameters
initialCapacityintThe number of objects to pre-create.
createFunc<T>A factory function to create new pool objects.
destroyAction<T>An optional callback invoked when an object is permanently removed from the pool.
activateAction<T>An optional callback invoked when an object is retrieved from the pool.
deactivateAction<T>An optional callback invoked when an object is returned to the pool.
comparerIEqualityComparer<T>An optional equality comparer for the pooled objects.