Class InputEventPool<TEventType>
Pools input events of a given type
public static class InputEventPool<TEventType> where TEventType : InputEvent, new()
Type Parameters
TEventType
The type of event to pool
- Inheritance
-
InputEventPool<TEventType>
Properties
ActiveObjects
The number of events in circulation, if this number keeps increasing, Enqueue is possible not called somewhere
public static int ActiveObjects { get; }
Property Value
Methods
Enqueue(TEventType)
Puts a used event back into the pool to be recycled
public static void Enqueue(TEventType item)
Parameters
item
TEventTypeThe event to reuse
GetOrCreate(IInputDevice)
Retrieves a new event that can be used, either from the pool or a new instance
public static TEventType GetOrCreate(IInputDevice device)
Parameters
device
IInputDeviceThe device that generates this event
Returns
- TEventType
An event