예제 #1
0
파일: Timer.cs 프로젝트: dmaulikr/OmegaRace
        public static void Remove(TimeEvent tE)
        {
            Debug.Assert(tE != null);

            Timer pTimer = Instance();

            pTimer.privActiveRemoveNode(tE, ref pTimer.active);
        }
예제 #2
0
파일: Timer.cs 프로젝트: dmaulikr/OmegaRace
        public static void Destroy()
        {
            // get instance
            Timer pTimer = Instance();
            // start the walk
            TimeEvent pEvent = pTimer.active;

            while (pEvent != null)
            {
                pTimer.privActiveRemoveNode(pEvent, ref pTimer.active);
                pEvent = pEvent.next;
            }
            // disable
            pTimer.initalized = false;
        }
예제 #3
0
파일: Timer.cs 프로젝트: dmaulikr/OmegaRace
        public static void Process(GameTime gameTime)
        {
            // get instance
            Timer pTimer = Instance();

            // Get the time from the beginning of game
            pTimer.currTime = gameTime.TotalGameTime;

            // start the walk
            TimeEvent pEvent = pTimer.active;

            while (pEvent != null)
            {
                if (pTimer.currTime >= pEvent.time)
                {
                    // remove node
                    pTimer.privActiveRemoveNode(pEvent, ref pTimer.active);
                    // call the callback
                    pEvent.funcCB(pEvent.dataCB);
                }
                // goto next time
                pEvent = pEvent.next;
            }
        }