public static void Remove(TimeEvent tE) { Debug.Assert(tE != null); Timer pTimer = Instance(); pTimer.privActiveRemoveNode(tE, ref pTimer.active); }
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; }
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; } }