Example #1
0
        /// <summary>
        /// Adds a new Action to the list of Actions to be executed every millis.
        /// </summary>
        /// <param name="callback"></param>
        public ObjectUpdateTimer CallPeriodically(int millis, Action <WorldObject> callback)
        {
            var action = new ObjectUpdateTimer(millis, callback);

            AddUpdateAction(action);
            return(action);
        }
Example #2
0
        /// <summary>
        /// Adds a new Action to the list of Actions to be executed every millis.
        /// </summary>
        /// <param name="callback"></param>
        public ObjectUpdateTimer CallPeriodicallyUntil(int callIntervalMillis, int callUntilMillis, Action <WorldObject> callback)
        {
            var action = new ObjectUpdateTimer(callIntervalMillis, callback);

            AddUpdateAction(action);
            CallDelayed(callUntilMillis, obj => RemoveUpdateAction(action));
            return(action);
        }
Example #3
0
 /// <summary>
 /// Adds a new Action to the list of Actions to be executed every action.Delay milliseconds
 /// </summary>
 public void AddUpdateAction(ObjectUpdateTimer timer)
 {
     if (m_updateActions == null)
     {
         m_updateActions = new List <ObjectUpdateTimer>(3);
     }
     timer.LastCallTime = m_lastUpdateTime;
     m_updateActions.Add(timer);
 }
Example #4
0
 /// <summary>
 /// Removes the given Action
 /// </summary>
 /// <param name="timer"></param>
 public bool RemoveUpdateAction(ObjectUpdateTimer timer)
 {
     if (m_updateActions != null)
     {
         if (m_updateActions.Remove(timer))
         {
             return(true);
         }
     }
     return(false);
 }
Example #5
0
 /// <summary>
 /// Removes the given Action
 /// </summary>
 /// <param name="timer"></param>
 public bool RemoveUpdateAction(ObjectUpdateTimer timer)
 {
     if (m_updateActions != null)
     {
         if (m_updateActions.Remove(timer))
         {
             return true;
         }
     }
     return false;
 }
Example #6
0
 /// <summary>
 /// Adds a new Action to the list of Actions to be executed every action.Delay milliseconds
 /// </summary>
 public void AddUpdateAction(ObjectUpdateTimer timer)
 {
     if (m_updateActions == null)
     {
         m_updateActions = new List<ObjectUpdateTimer>(3);
     }
     timer.LastCallTime = m_lastUpdateTime;
     m_updateActions.Add(timer);
 }
Example #7
0
 /// <summary>
 /// Adds a new Action to the list of Actions to be executed every millis.
 /// </summary>
 /// <param name="callback"></param>
 public ObjectUpdateTimer CallPeriodicallyUntil(int callIntervalMillis, int callUntilMillis, Action<WorldObject> callback)
 {
     var action = new ObjectUpdateTimer(callIntervalMillis, callback);
     AddUpdateAction(action);
     CallDelayed(callUntilMillis, obj => RemoveUpdateAction(action));
     return action;
 }
Example #8
0
 /// <summary>
 /// Adds a new Action to the list of Actions to be executed every millis.
 /// </summary>
 /// <param name="callback"></param>
 public ObjectUpdateTimer CallPeriodically(int millis, Action<WorldObject> callback)
 {
     var action = new ObjectUpdateTimer(millis, callback);
     AddUpdateAction(action);
     return action;
 }
Example #9
0
			public override void Start()
			{
				decreptifyTimer = m_owner.CallPeriodically(Utility.Random(5000, 10000), CastDecrepify);
				base.Start();
			}