Exemple #1
0
        /// <summary>
        /// 取消心跳
        /// </summary>
        /// <param name="timer"></param>
        public void Unreg(int timer)
        {
            var update = Updatables.Find(x => x.Id == timer);

            if (update != null)
            {
                UnregisterUpdatable(update);
            }
        }
Exemple #2
0
        public float GetIntervalMS(int timer)
        {
            //IUpdatable te;

            //Updatables.TryGetValue(timer, out te);

            //if (te != null)
            //{
            //    var t = te as TimerEntry;
            //    return t.Interval;
            //}

            var update = (TimerEntry)Updatables.Find(x => x.Id == timer);

            if (update != null)
            {
                return(update.Interval);
            }

            return(0f);
        }
Exemple #3
0
 /// <summary>
 /// 是否包含计时器
 /// </summary>
 /// <param name="timer"></param>
 /// <returns></returns>
 public bool ContainsTimer(int timer)
 {
     return(Updatables.Find(x => x.Id == timer) != null);
 }