Example #1
0
        public void Update(float time)
        {
            TimerEvent crntEvent = (TimerEvent)this.poActiveHead;
            TimerEvent nextEvent;

            currentTime = time;

            //this.dbgPrintLists();

            while (crntEvent != null && crntEvent.triggerTime <= time)
            {
                nextEvent = (TimerEvent)crntEvent.pNext;
                // Process the event
                crntEvent.process();
                // Remove processed event
                Remove(crntEvent);
                // move crnt to next
                crntEvent = nextEvent;
            }
        }
        public static void update(float totalTime)
        {
            TimerManager timerManager = TimerManager.getSingletonInstance();

            timerManager.currTime = totalTime;
            TimerEvent mEvent    = (TimerEvent)timerManager.activeList;
            TimerEvent nextEvent = null;

            //  bool eventOcc = false;
            while (mEvent != null && (timerManager.currTime >= mEvent.cTriggerTime))
            {
                //   eventOcc = true;
                nextEvent = (TimerEvent)mEvent.pNext;

                if (timerManager.currTime >= mEvent.cTriggerTime)
                {
                    mEvent.process();
                    mEvent.washTimeEvent();
                    TimerManager.remove(mEvent);
                }
                mEvent = nextEvent;
            }
        }