Ejemplo n.º 1
0
 public static void remove(TimerEvent mTimerEvent)
 {
     Debug.Assert(timerMInstance != null);
     Debug.Assert(mTimerEvent != null);
     timerMInstance.genericRemove(mTimerEvent);
 }
Ejemplo n.º 2
0
        public static void UpdateTimerManager(Grid pGrid)
        {
            float decayFactor     = pGrid.decayFactor;
            float bombDecayFactor = pGrid.bombDecayFactor;

            pGrid.UpdateMarchSpeed(decayFactor);
            pGrid.UpdateBombFrequency();

            float   newTriggerTime;
            float   newDeltaTime;
            Command cmd;
            // need to update the game TimerEvents to accommodate updated values
            TimerEvent timerEvent = TimerManager.Find(TimerEventName.MoveGrid);

            if (timerEvent != null)
            {
                newTriggerTime = timerEvent.triggerTime - decayFactor;
                newDeltaTime   = timerEvent.deltaTime - decayFactor;
                cmd            = timerEvent.command;
                TimerManager.Remove(timerEvent);
                TimerManager.Add(TimerEventName.MoveGrid, newTriggerTime, newDeltaTime, cmd);
            }

            timerEvent = TimerManager.Find(TimerEventName.AnimateSquids);
            if (timerEvent != null)
            {
                newTriggerTime = timerEvent.triggerTime - decayFactor;
                newDeltaTime   = timerEvent.deltaTime - decayFactor;
                cmd            = timerEvent.command;
                TimerManager.Remove(timerEvent);
                TimerManager.Add(TimerEventName.AnimateSquids, newTriggerTime, newDeltaTime, cmd);
            }

            timerEvent = TimerManager.Find(TimerEventName.AnimateCrabs);
            if (timerEvent != null)
            {
                newTriggerTime = timerEvent.triggerTime - decayFactor;
                newDeltaTime   = timerEvent.deltaTime - decayFactor;
                cmd            = timerEvent.command;
                TimerManager.Remove(timerEvent);
                TimerManager.Add(TimerEventName.AnimateCrabs, newTriggerTime, newDeltaTime, cmd);
            }

            timerEvent = TimerManager.Find(TimerEventName.AnimateOctopi);
            if (timerEvent != null)
            {
                newTriggerTime = timerEvent.triggerTime - decayFactor;
                newDeltaTime   = timerEvent.deltaTime - decayFactor;
                cmd            = timerEvent.command;
                TimerManager.Remove(timerEvent);
                TimerManager.Add(TimerEventName.AnimateOctopi, newTriggerTime, newDeltaTime, cmd);
            }

            timerEvent = TimerManager.Find(TimerEventName.PlayFastInvaders4);
            if (timerEvent != null)
            {
                newTriggerTime = timerEvent.triggerTime - decayFactor * 4;
                newDeltaTime   = timerEvent.deltaTime - decayFactor * 4;
                cmd            = timerEvent.command;
                TimerManager.Remove(timerEvent);
                TimerManager.Add(TimerEventName.PlayFastInvaders4, newTriggerTime, newDeltaTime, cmd);
            }

            timerEvent = TimerManager.Find(TimerEventName.PlayFastInvaders1);
            if (timerEvent != null)
            {
                newTriggerTime = timerEvent.triggerTime - decayFactor * 4;
                newDeltaTime   = timerEvent.deltaTime - decayFactor * 4;
                cmd            = timerEvent.command;
                TimerManager.Remove(timerEvent);
                TimerManager.Add(TimerEventName.PlayFastInvaders1, newTriggerTime, newDeltaTime, cmd);
            }

            timerEvent = TimerManager.Find(TimerEventName.PlayFastInvaders2);
            if (timerEvent != null)
            {
                newTriggerTime = timerEvent.triggerTime - decayFactor * 4;
                newDeltaTime   = timerEvent.deltaTime - decayFactor * 4;
                cmd            = timerEvent.command;
                TimerManager.Remove(timerEvent);
                TimerManager.Add(TimerEventName.PlayFastInvaders2, newTriggerTime, newDeltaTime, cmd);
            }

            timerEvent = TimerManager.Find(TimerEventName.PlayFastInvaders3);
            if (timerEvent != null)
            {
                newTriggerTime = timerEvent.triggerTime - decayFactor * 4;
                newDeltaTime   = timerEvent.deltaTime - decayFactor * 4;
                cmd            = timerEvent.command;
                TimerManager.Remove(timerEvent);
                TimerManager.Add(TimerEventName.PlayFastInvaders3, newTriggerTime, newDeltaTime, cmd);
            }

            timerEvent = TimerManager.Find(TimerEventName.BombSpawn);
            if (timerEvent != null)
            {
                newTriggerTime = timerEvent.triggerTime - bombDecayFactor;
                newDeltaTime   = timerEvent.deltaTime - bombDecayFactor;
                cmd            = timerEvent.command;
                TimerManager.Remove(timerEvent);
                TimerManager.Add(TimerEventName.BombSpawn, newTriggerTime, newDeltaTime, cmd);
            }
        }
Ejemplo n.º 3
0
 private TimerMan(int reserveNum = 3, int reserveGrow = 1)
     : base()
 {
     this.BaseInitialize(reserveNum, reserveGrow);
     this.poNodeCompare = new TimerEvent();
 }
Ejemplo n.º 4
0
        protected override DLink CreateNode()
        {
            DLink dLink = new TimerEvent();

            return(dLink);
        }