Table of Contents

Class PoolExtensions

Namespace
Gamelogic.Extensions
Assembly
Gamelogic.Extensions.dll
public static class PoolExtensions
Inheritance
PoolExtensions
Inherited Members

Methods

AddAllAvailableFromPool<T>(ICollection<T>, IPool<T>)

Adds all available objects from the pool to the collection, activating each of them.

AddFromPool<T>(ICollection<T>, IPool<T>, int)

Gets a number of objects from a pool, and adds them to the given collection.

Clear<T>(IPool<T>, bool)

Destroys all objects in the pool, reducing the capacity to zero.

GetHashPool<T>(int, Func<T>, Action<T>, Action<T>, Action<T>)

Gets a hash pool for any type - hashable or not.

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.

Trim<T>(IPool<T>)

Sets the capacity of the pool to the current active count.

TryAddFromPool<T>(ICollection<T>, IPool<T>, int)

Gets a number of objects from a pool, and adds them to the given collection.

TryGet<T>(IPool<T>, out T)

Gets an item from the pool if one is available.