Table of Contents

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

initialCount int

The initial number of objects to create.

create Func<T>

A function that creates a new object of type T.

kill Action<T>

The function that destroys an object of type T.

wakeUp Action<T>

A function called when an object is woken up.

setToSleep Action<T>

A function called when an object is set to sleep.