Esempio n. 1
0
 /// <summary>
 /// StopUpdating calling the given method periodically. Note that the method must be equal to a previously added method
 /// in the sense of pointer equality for it to be removed successfully.
 /// </summary>
 public void StopCallPeriodically(PeriodicMethod method)
 {
     PeriodicMethodClass toRemove = null;
     foreach (PeriodicMethodClass methodClass in methodsToCall)
     {
         if (methodClass.method == method)
         {
             toRemove = methodClass;
         }
     }
     if (toRemove != null)
     {
         methodsToCall.Remove(toRemove);
     }
 }
Esempio n. 2
0
    /// <summary>
    /// StopUpdating calling the given method periodically. Note that the method must be equal to a previously added method
    /// in the sense of pointer equality for it to be removed successfully.
    /// </summary>
    public void StopCallPeriodically(PeriodicMethod method)
    {
        PeriodicMethodClass toRemove = null;

        foreach (PeriodicMethodClass methodClass in methodsToCall)
        {
            if (methodClass.method == method)
            {
                toRemove = methodClass;
            }
        }
        if (toRemove != null)
        {
            methodsToCall.Remove(toRemove);
        }
    }
Esempio n. 3
0
 /// <summary>
 /// Add a method to be called periodically every secondsBetweenCalls seconds.
 /// </summary>
 public void StartCallPeriodically(PeriodicMethod method, float secondsBetweenCalls)
 {
     methodsToCall.Add(new PeriodicMethodClass(method, secondsBetweenCalls));
 }
Esempio n. 4
0
 public PeriodicMethodClass(PeriodicMethod method, float timeBetweenCalls)
 {
     this.method            = method;
     this.timeBetweenCalls  = timeBetweenCalls;
     this.timeSinceLastCall = timeBetweenCalls;
 }
Esempio n. 5
0
 /// <summary>
 /// Add a method to be called periodically every secondsBetweenCalls seconds.
 /// </summary>
 public void StartCallPeriodically(PeriodicMethod method, float secondsBetweenCalls)
 {
     methodsToCall.Add(new PeriodicMethodClass(method, secondsBetweenCalls));
 }
Esempio n. 6
0
 public PeriodicMethodClass(PeriodicMethod method, float timeBetweenCalls)
 {
     this.method = method;
     this.timeBetweenCalls = timeBetweenCalls;
     this.timeSinceLastCall = timeBetweenCalls;
 }