Table of Contents

Method TryGet

Namespace
Gamelogic.Extensions
Assembly
Gamelogic.Extensions.dll

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

Gets an item from the pool if one is available.

public static bool TryGet<T>(this IPool<T> pool, out T obj)

Parameters

pool IPool<T>

The pool to get an object from.

obj T

The object that was acquired, or the default value of T if no object was available.

Returns

bool

true if an object was acquired, false otherwise.

Type Parameters

T

The type of the objects in the pool.