예제 #1
0
 // Token: 0x060015F3 RID: 5619 RVA: 0x00026730 File Offset: 0x00025730
 private static void Remove(Timer timer)
 {
     Timer.TimerInfo timerInfo = Timer.ScheduledTimers.Find((Timer.TimerInfo pair) => pair.Timer == timer);
     if (timerInfo != null)
     {
         timerInfo.Timer = null;
         Timer.ScheduledTimers.Remove(timerInfo);
     }
 }
예제 #2
0
 // Token: 0x060015F2 RID: 5618 RVA: 0x000266E4 File Offset: 0x000256E4
 private static void Insert(float timeFromNow, Timer timer)
 {
     Timer.TimerInfo item = new Timer.TimerInfo
     {
         StartTick = Simulation.GetTick(),
         Timer     = timer
     };
     Timer.ScheduledTimers.Add(item);
 }
예제 #3
0
 // Token: 0x060015F1 RID: 5617 RVA: 0x00026658 File Offset: 0x00025658
 public static void Update()
 {
     Timer.TimerInfo[] array = new Timer.TimerInfo[Timer.ScheduledTimers.Count];
     Timer.ScheduledTimers.CopyTo(array);
     foreach (Timer.TimerInfo timerInfo in array)
     {
         float num = (float)TimeSpan.FromMilliseconds(Simulation.GetTickDifference(timerInfo.StartTick)).TotalSeconds;
         if (timerInfo.Timer == null)
         {
             Timer.ScheduledTimers.Remove(timerInfo);
         }
         if (num >= timerInfo.Timer.Interval)
         {
             timerInfo.Timer.OnElapsed();
         }
     }
 }