Table of Contents

Method TryAddFromPool

Namespace
Gamelogic.Extensions
Assembly
Gamelogic.Extensions.dll

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

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

public static int TryAddFromPool<T>(this ICollection<T> collection, IPool<T> pool, int count)

Parameters

collection ICollection<T>

The collection to add objects to.

pool IPool<T>

The pool to get objects from.

count int

The number of objects to get.

Returns

int

The number of objects that were added to the collection.

Type Parameters

T

The type of the objects in the pool.