Table of Contents

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

initialCapacity int

The number of objects to pre-create.

create Func<T>

A factory function to create new pool objects.

destroy Action<T>

An optional callback invoked when an object is permanently removed from the pool.

activate Action<T>

An optional callback invoked when an object is retrieved from the pool.

deactivate Action<T>

An optional callback invoked when an object is returned to the pool.

comparer IEqualityComparer<T>

An optional equality comparer for the pooled objects.