Table of Contents

Interface IPooledObjectPolicy<T>

Namespace
RichHudFramework
Assembly
RichHudClient.dll

Defines the creation and reset behavior for objects managed by an ObjectPool<T>.

public interface IPooledObjectPolicy<T>

Type Parameters

T

Methods

GetNewObject()

Creates a fresh instance of T.

T GetNewObject()

Returns

T

ResetObject(T)

Prepares a used object for reuse (e.g. clears state, unsubscribes events). Called immediately before the object is returned to the pool.

void ResetObject(T obj)

Parameters

obj T

ResetRange(IReadOnlyList<T>, int, int)

Resets a contiguous range of pooled objects in a list.

void ResetRange(IReadOnlyList<T> objects, int index, int count)

Parameters

objects IReadOnlyList<T>
index int
count int

ResetRange<T2>(IReadOnlyList<MyTuple<T, T2>>, int, int)

Resets the contiguous range of pooled objects in a list of tuples.

void ResetRange<T2>(IReadOnlyList<MyTuple<T, T2>> objects, int index, int count)

Parameters

objects IReadOnlyList<MyTuple<T, T2>>
index int
count int

Type Parameters

T2