예제 #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);
            }
        }
예제 #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);
        }
예제 #3
0
 /// <summary>
 /// 是否包含计时器
 /// </summary>
 /// <param name="timer"></param>
 /// <returns></returns>
 public bool ContainsTimer(int timer)
 {
     return(Updatables.Find(x => x.Id == timer) != null);
 }