Constructor Pool
- Namespace
- Gamelogic.Extensions
- Assembly
- Gamelogic.Extensions.dll
Pool(int, Func<T>, Action<T>, Action<T>, Action<T>)
Initializes a new instance of the Pool<T> class.
public Pool(int initialCount, Func<T> create, Action<T> kill, Action<T> wakeUp, Action<T> setToSleep)
Parameters
initialCountintThe initial number of objects to create.
createFunc<T>A function that creates a new object of type T.
killAction<T>The function that destroys an object of type T.
wakeUpAction<T>A function called when an object is woken up.
setToSleepAction<T>A function called when an object is set to sleep.