Struct PoolListStruct<T>
- Namespace
- Stride.Core.Collections
- Assembly
- Stride.Core.dll
A pool of objects allocated and can be cleared without losing previously allocated instance.
public struct PoolListStruct<T> : IEnumerable<T>, IEnumerable where T : classType Parameters
- T
- Type of the pooled object 
- Implements
- 
      IEnumerable<T>
- Inherited Members
- Extension Methods
Constructors
PoolListStruct(int, Func<T>)
Initializes a new instance of the PoolListStruct<T> struct.
public PoolListStruct(int capacity, Func<T> factory)Parameters
Exceptions
- ArgumentNullException
- factory 
Fields
Count
The number of objects in use, readonly.
public int CountField Value
Properties
this[int]
Gets or sets the item at the specified index.
public readonly T this[int index] { get; set; }Parameters
- indexint
- The index. 
Property Value
- T
- An instance of T 
this[uint]
Gets or sets the item at the specified index.
public readonly T this[uint index] { get; set; }Parameters
- indexuint
- The index. 
Property Value
- T
- An instance of T 
Methods
Add()
Adds a new object in use to this instance.
public T Add()Returns
- T
- An instance of T 
Clear()
Clears objects in use and keep allocated objects.
public void Clear()GetEnumerator()
public readonly FastListStruct<T>.Enumerator GetEnumerator()Returns
IndexOf(T)
Gets the index of item
public readonly int IndexOf(T item)Parameters
- itemT
- The item to get the index of 
Returns
- int
- Index of the item, or -1 if the item is not in this list 
Remove(T)
Removes the object from the list
public void Remove(T item)Parameters
- itemT
- The item to remove 
Remarks
The item is added back in the pool to be reused for the next Add()
RemoveAt(int)
public void RemoveAt(int index)Parameters
- indexint
Reset()
Resets this instance by releasing allocated objects.
public void Reset()