예제 #1
0
        public int AddTimer(int delta, LmTimerType timerType)
        {
            LmTimerItem timer = null;

            lock (_TimerLock)
            {
                int timerId = m_nTimerIdCtr++;
                timer = new LmTimerItem(timerId, delta, timerType);
                //if (_Items.ContainsID(timerId))
                //{
                //}
                _Items.Add(timer);

                // start timer manager
                if (_IsAutoStart && _IsRunning == false)
                {
                    Start();
                }
            }

            // reinit timer
            RestartTimer(timer.Id);

            return(timer.Id);
        }
예제 #2
0
 public LmTimerItem(int id, int delta, LmTimerType type)
 {
     Id        = id;
     Delta     = delta;
     TimerType = type;
 }
예제 #3
0
파일: LmTimer.cs 프로젝트: Xtremrules/dot42
			public LmTimerItem(int id, int delta, LmTimerType type)
			{
				Id = id;
				Delta = delta;
				TimerType = type;
			}
예제 #4
0
파일: LmTimer.cs 프로젝트: Xtremrules/dot42
		public int AddTimer(int delta, LmTimerType timerType)
		{
			LmTimerItem timer = null;

			lock (_TimerLock)
			{
				int timerId = m_nTimerIdCtr++;
				timer = new LmTimerItem(timerId, delta, timerType);
				//if (_Items.ContainsID(timerId))
				//{
				//}
				_Items.Add(timer);

				// start timer manager
				if (_IsAutoStart && _IsRunning == false)
				{
					Start();
				}
			}

			// reinit timer
			RestartTimer(timer.Id);

			return timer.Id;
		}