Class DictionaryPool<TKey, TValue>
Defines a system used to store and retrieve System.Collections.Generic.Dictionary<TKey, TValue> objects.
Inheritance
Implements
Inherited Members
Namespace: Exiled.API.Features.Pools
Assembly: Exiled.API.dll
Syntax
public class DictionaryPool<TKey, TValue> : IPool<Dictionary<TKey, TValue>>
Type Parameters
Name | Description |
---|---|
TKey | The type of the key in the dictionary. |
TValue | The type of the value in the dictionary. |
Properties
| Improve this Doc View SourcePool
Gets a DictionaryPool<TKey, TValue> that stores dictionaries.
Declaration
public static DictionaryPool<TKey, TValue> Pool { get; }
Property Value
Type | Description |
---|---|
DictionaryPool<TKey, TValue> |
Methods
| Improve this Doc View SourceGet()
Rent a System.Collections.Generic.Dictionary<TKey, TValue> temporarily.
Declaration
public Dictionary<TKey, TValue> Get()
Returns
Type | Description |
---|---|
System.Collections.Generic.Dictionary<TKey, TValue> | The System.Collections.Generic.Dictionary<TKey, TValue>. |
Get(IEnumerable<KeyValuePair<TKey, TValue>>)
Rent a System.Collections.Generic.Dictionary<TKey, TValue> temporarily. Fills it with the provided System.Collections.Generic.IEnumerable<T> of System.Collections.Generic.KeyValuePair<TKey, TValue>.
Declaration
public Dictionary<TKey, TValue> Get(IEnumerable<KeyValuePair<TKey, TValue>> pairs)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<TKey, TValue>> | pairs | The items to fill the dictionary with. |
Returns
Type | Description |
---|---|
System.Collections.Generic.Dictionary<TKey, TValue> | The System.Collections.Generic.Dictionary<TKey, TValue>. |
Return(Dictionary<TKey, TValue>)
Returns a finished System.Collections.Generic.Dictionary<TKey, TValue> to the pool, clearing all of its contents.
Declaration
public void Return(Dictionary<TKey, TValue> obj)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.Dictionary<TKey, TValue> | obj | The System.Collections.Generic.Dictionary<TKey, TValue> to return. |
ToArrayReturn(Dictionary<TKey, TValue>)
Returns the System.Collections.Generic.Dictionary<TKey, TValue> to the pool and returns its contents as an array.
Declaration
public KeyValuePair<TKey, TValue>[] ToArrayReturn(Dictionary<TKey, TValue> obj)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.Dictionary<TKey, TValue> | obj | The System.Collections.Generic.Dictionary<TKey, TValue> to return. |
Returns
Type | Description |
---|---|
System.Collections.Generic.KeyValuePair<TKey, TValue>[] | The contents of the returned dictionary as an array. |