Beispiel #1
0
 /// <summary>
 /// 初始化事件池的新实例。
 /// </summary>
 /// <param name="mode">事件池模式。</param>
 public EventPool(EventPoolMode mode)
 {
     m_EventHandlers  = new Dictionary <int, LinkedList <EventHandler <T> > >();
     m_Events         = new Queue <Event>();
     m_EventPoolMode  = mode;
     m_DefaultHandler = null;
 }
Beispiel #2
0
 public EventPool(EventPoolMode eventPoolMode, int maxOperatorNumber = 64)
 {
     events                 = new Dictionary <int, EventHandler <T> >();
     eventList              = new SafetyQueue <LE_Event <T> >();
     this.eventPoolMode     = eventPoolMode;
     this.maxOperatorNumber = maxOperatorNumber;
 }
Beispiel #3
0
 /// <summary>
 /// 初始化事件池的新实例。
 /// </summary>
 /// <param name="mode">事件池模式。</param>
 public EventPool(EventPoolMode mode)
 {
     m_EventHandlers  = new Dictionary <int, GameFrameworkLinkedList <EventHandler <T> > >();
     m_Events         = new Queue <Event>();
     m_CachedNodes    = new Dictionary <object, LinkedListNode <EventHandler <T> > >();
     m_TempNodes      = new Dictionary <object, LinkedListNode <EventHandler <T> > >();
     m_EventPoolMode  = mode;
     m_DefaultHandler = null;
 }
Beispiel #4
0
 /// <summary>
 /// 初始化事件池的新实例
 /// </summary>
 /// <param name="mode"></param>
 public EventPool(EventPoolMode mode)
 {
     _eventHandlers  = new Dictionary <int, LinkedList <EventHandler <T> > >();
     _events         = new Queue <Event>();
     _cachedNodes    = new Dictionary <object, LinkedListNode <EventHandler <T> > >();
     _tempNodes      = new Dictionary <object, LinkedListNode <EventHandler <T> > >();
     _eventPoolMode  = mode;
     _defaultHandler = null;
 }
Beispiel #5
0
 public EventPool(EventPoolMode mode)
 {
     m_EventHandlers = new Dictionary <int, EventHandler <T> >();
     m_Events        = new Queue <Event>();
     m_EventPoolMode = mode;
 }
Beispiel #6
0
 public static void OnInit(EventPoolMode mode)
 {
     eventPool = new EventPool <T>(mode);
 }