public static void PushToMemento(TimerMemento pMemento, float currTime) { TimerManager pMan = TimerManager.PrivGetInstance(); Debug.Assert(pMan != null); pMan.BasePushToMemento(pMemento); pMemento.mCurrTime = currTime; }
public PlayerArtifact(Name name) { this.name = name; this.lives = 3; this.score = 0; this.level = 1; this.pGrid = null; this.pShieldZone = null; this.pTimerMemento = new TimerMemento(); this.pGameObjectMemento = new ManagerMemento(); this.pColPairMemento = new ManagerMemento(); this.pSpritesSBNodeMemento = new ManagerMemento(); this.pSpriteBoxesSBNodeMemento = new ManagerMemento(); }
public static void PullFromMemento(TimerMemento pMemento, float currTime) { float elapsedTime = currTime - pMemento.mCurrTime; Debug.Assert(elapsedTime >= 0); TimerManager pMan = TimerManager.PrivGetInstance(); Debug.Assert(pMan != null); pMan.BasePullFromMemento(pMemento); // update all of the times on the event chain TimeEvent pNode = (TimeEvent)pMan.BaseGetActive(); while (pNode != null) { pNode.triggerTime += elapsedTime; pNode = (TimeEvent)pNode.GetNext(); } }