Exemplo n.º 1
0
        private void DoTimer()
        {
            Timer self  = this;
            long  delay = (long)(seconds * 1000);

            if (repeat)
            {
                GameClock.Delay(delay, () => {
                    if (self == null)
                    {
                        return;
                    }
                    DoTimer();
                });
            }
            Incident todo;
            object   whatToDo = whatToActivate.Data;
            bool     activate = !deactivate;

            if (relentlessTimer)
            {
                todo = GameClock.Delay(delay, () => ActivateAnything.DoActivate(whatToDo, this, null, activate));
            }
            else
            {
                todo = GameClock.Delay(delay, () => {
                    if (self == null)
                    {
                        return;                                   // if this timer is destroyed, don't activate
                    }
                    ActivateAnything.DoActivate(whatToDo, this, null, activate);
                });
            }
            todo.Source = this;
        }
Exemplo n.º 2
0
 public void DoActivateTrigger()
 {
     ActivateAnything.DoActivate(whatToActivate.Data, this, null, !deactivate);
 }