Class ObjectCaches<T>
Caches objects of a single generic.
Inheritance
System.Object
ObjectCaches<T>
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: GameKit.Dependencies.Utilities
Assembly: GameKit.Dependencies.dll
Syntax
public static class ObjectCaches<T>
where T : new()
Type Parameters
Name | Description |
---|---|
T |
Methods
Retrieve()
Returns a value from the stack or creates an instance when the stack is empty.
Declaration
public static T Retrieve()
Returns
Type | Description |
---|---|
T |
Store(T)
Stores a value to the stack.
Declaration
public static void Store(T value)
Parameters
Type | Name | Description |
---|---|---|
T | value |
StoreAndDefault(ref T)
Stores an instance of T and sets the original reference to default. Method will not execute if value is null.
Declaration
public static void StoreAndDefault(ref T value)
Parameters
Type | Name | Description |
---|---|---|
T | value | Value to store. |