示例#1
0
        public MagmaTE CreateParallelTimer(string name, int timeoutDelay, Dictionary <string, object> args)
        {
            MagmaTE timedEvent = new MagmaTE(name, timeoutDelay, args);

            timedEvent.OnFire += new MagmaTE.TimedEventFireDelegate(Plugin.OnTimerCB);
            ParallelTimers.Add(timedEvent);
            return(timedEvent);
        }
示例#2
0
 public void OnTimerCB(MagmaTE evt)
 {
     try
     {
         Invoke(evt.Name + "Callback", evt);
     }
     catch (Exception ex)
     {
         Fougerite.Logger.LogError("Failed to invoke callback " + evt.Name + " Ex: " + ex);
     }
 }
示例#3
0
        public void KillTimer(string name)
        {
            MagmaTE timer = GetTimer(name);

            if (timer == null)
            {
                return;
            }

            timer.Kill();
            Timers.Remove(name);
        }
示例#4
0
        public MagmaTE CreateTimer(string name, int timeoutDelay)
        {
            MagmaTE timedEvent = GetTimer(name);

            if (timedEvent == null)
            {
                timedEvent         = new MagmaTE(name, (double)timeoutDelay);
                timedEvent.OnFire += new MagmaTE.TimedEventFireDelegate(Plugin.OnTimerCB);
                Timers.Add(name, timedEvent);
            }
            return(timedEvent);
        }