コード例 #1
0
        public static void PushToMemento(TimerMemento pMemento, float currTime)
        {
            TimerManager pMan = TimerManager.PrivGetInstance();

            Debug.Assert(pMan != null);
            pMan.BasePushToMemento(pMemento);
            pMemento.mCurrTime = currTime;
        }
コード例 #2
0
        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();
        }
コード例 #3
0
        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();
            }
        }