Exemplo n.º 1
0
        // -------------------------------------------

        /*
         * ProcessTimedEvents
         */
        private void ProcessTimedEvents()
        {
            switch (m_state)
            {
            case STATE_IDLE:
                for (int i = 0; i < m_listTimedEvents.Count; i++)
                {
                    CommEventData eventData = m_listTimedEvents[i];
                    eventData.Time -= Time.deltaTime;
                    if (eventData.Time <= 0)
                    {
                        m_listTimedEvents.RemoveAt(i);
                        Request(eventData.NameEvent, eventData.IsBinaryResponse, eventData.List);
                        eventData.Destroy();
                        break;
                    }
                }
                break;
            }
        }
Exemplo n.º 2
0
        // -------------------------------------------

        /*
         * ProcesQueuedComms
         */
        private void ProcesQueuedComms()
        {
            // PRIORITY QUEUE
            if (m_priorityQueuedEvents.Count > 0)
            {
                int           i         = 0;
                CommEventData eventData = m_priorityQueuedEvents[i];
                m_priorityQueuedEvents.RemoveAt(i);
                Request(eventData.NameEvent, eventData.IsBinaryResponse, eventData.List);
                eventData.Destroy();
                return;
            }
            // NORMAL QUEUE
            if (m_listQueuedEvents.Count > 0)
            {
                int           i         = 0;
                CommEventData eventData = m_listQueuedEvents[i];
                m_listQueuedEvents.RemoveAt(i);
                Request(eventData.NameEvent, eventData.IsBinaryResponse, eventData.List);
                eventData.Destroy();
                return;
            }
        }