Example #1
0
        public TimedTimerEntry CallPeriodically(int interval, Action action)
        {
            TimedTimerEntry timedTimerEntry = new TimedTimerEntry
            {
                Interval = interval,
                Action   = action
            };

            timedTimerEntry.Start();
            this.RegisterTimerLater(timedTimerEntry);
            return(timedTimerEntry);
        }
Example #2
0
        public virtual void AddTimer(TimedTimerEntry timer)
        {
            ExecuteInContext(() =>
            {
                if (!timer.Enabled)
                {
                    timer.Start();
                }

                m_timers.Push(timer);
            });
        }
Example #3
0
File: Area.cs Project: Mixi59/Stump
        public TimedTimerEntry CallPeriodically(int interval, Action action)
        {
            var timer = new TimedTimerEntry
            {
                Interval = interval,
                Action   = action
            };

            timer.Start();
            RegisterTimer(timer);
            return(timer);
        }
Example #4
0
File: Area.cs Project: Mixi59/Stump
        public void RegisterTimer(TimedTimerEntry timer)
        {
            ExecuteInContext(() =>
            {
                if (!timer.Enabled)
                {
                    timer.Start();
                }

                m_timers.Push(timer);
            });
        }
Example #5
0
        public void Start()
        {
            if (Running)
            {
                return;
            }

            Running = true;
            TaskPool.Start();

            m_updateTimer.Start();
            TaskPool.AddTimer(m_updateTimer);
        }
Example #6
0
        public TimedTimerEntry CallDelayed(int delay, Action action)
        {
            TimedTimerEntry timedTimerEntry = new TimedTimerEntry
            {
                Interval = -1,
                Delay    = delay,
                Action   = action
            };

            timedTimerEntry.Start();
            this.RegisterTimerLater(timedTimerEntry);
            return(timedTimerEntry);
        }
Example #7
0
File: Area.cs Project: Mixi59/Stump
        public TimedTimerEntry CallDelayed(int delay, Action action)
        {
            var timer = new TimedTimerEntry
            {
                Interval = -1,
                Delay    = delay,
                Action   = action
            };

            timer.Start();
            RegisterTimer(timer);
            return(timer);
        }