Class EventBase<T>
Generic base class for events, implementing event pooling and automatic registration to the event type system.
public abstract class EventBase<T> : EventBase, IDisposable where T : EventBase<T>, new()
Type Parameters
T
- Inheritance
-
EventBase<T>
- Implements
- Derived
- Inherited Members
- Extension Methods
Constructors
EventBase()
protected EventBase()
Properties
EventTypeId
Retrieves the type ID for this event instance.
public override long EventTypeId { get; }
Property Value
Methods
Acquire()
public override void Acquire()
Dispose()
Implementation of IDispose.
public override sealed void Dispose()
Remarks
If the event was instantiated from an event pool, the event is released when Dispose is called.
GetPooled()
Gets an event from the event pool. Use this function instead of creating new events.
Events obtained using this method need to be released back to the pool. You can use Dispose() to release them.
public static T GetPooled()
Returns
- T
An initialized event.
Init()
Resets all event members to their initial values.
protected override void Init()
TypeId()
Retrieves the type ID for this event instance.
public static long TypeId()
Returns
- long
The type ID.