Class ListPool<T>
Defines a system used to store and retrieve System.Collections.Generic.List<T> objects.
Inheritance
Implements
Inherited Members
Namespace: Exiled.API.Features.Pools
Assembly: Exiled.API.dll
Syntax
public class ListPool<T> : IPool<List<T>>
Type Parameters
Name | Description |
---|---|
T | The type of the objects in the list. |
Properties
| Improve this Doc View SourcePool
Gets a ListPool<T> that stores lists.
Declaration
public static ListPool<T> Pool { get; }
Property Value
Type | Description |
---|---|
ListPool<T> |
Methods
| Improve this Doc View SourceGet()
Declaration
public List<T> Get()
Returns
Type | Description |
---|---|
System.Collections.Generic.List<T> |
Get(IEnumerable<T>)
Retrieves a stored object of type System.Collections.Generic.List<T>, or creates it if it does not exist. The list will be filled with all the provided items
.
Declaration
public List<T> Get(IEnumerable<T> items)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEnumerable<T> | items | The items to fill the list with. |
Returns
Type | Description |
---|---|
System.Collections.Generic.List<T> | The stored object, or a new object, of type System.Collections.Generic.List<T>. |
Get(Int32)
Retrieves a stored object of type System.Collections.Generic.List<T>, or creates it if it does not exist. The capacity of the list will be equal to or greater than capacity
.
Declaration
public List<T> Get(int capacity)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | capacity | The capacity of content in the System.Collections.Generic.List<T>. |
Returns
Type | Description |
---|---|
System.Collections.Generic.List<T> | The stored object, or a new object, of type System.Collections.Generic.List<T>. |
Return(List<T>)
Declaration
public void Return(List<T> obj)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.List<T> | obj |
ToArrayReturn(List<T>)
Returns the System.Collections.Generic.List<T> to the pool and returns its contents as an array.
Declaration
public T[] ToArrayReturn(List<T> obj)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.List<T> | obj | The System.Collections.Generic.List<T> to return. |
Returns
Type | Description |
---|---|
T[] | The contents of the returned list as an array. |