示例#1
0
 internal Cv_EventListenerHandle(int ID)
 {
     ListenerID       = ID;
     Delegate         = null;
     ScriptDelegate   = "";
     IsScriptListener = false;
     EventType        = Cv_EventType.INVALID_EVENT;
     Entity           = null;
     EventName        = "";
     Manager          = null;
 }
示例#2
0
        public Cv_EventManager(bool global)
        {
            MaxProcessTimeMillis = long.MaxValue;

            if (global)
            {
                if (Instance != null)
                {
                    Cv_Debug.Error("Attempting to create two EventManagers as global. The old one will be overwritten.");
                }

                Instance = this;
            }

            m_RealTimeEventQueue   = new ConcurrentQueue <Cv_Event>();
            m_EventListeners       = new Dictionary <Cv_EventType, List <NewEventDelegate> >();
            m_ScriptEventListeners = new Dictionary <Cv_EventType, List <Cv_ScriptListener> >();

            m_EventQueues = new LinkedList <Cv_Event> [NUM_QUEUES];
            for (int i = 0; i < NUM_QUEUES; i++)
            {
                m_EventQueues[i] = new LinkedList <Cv_Event>();
            }
        }