public void Tick()
    {
        double num1 = 10000000.0 * (1440.0 / (double)SynchronizedClock.DayLengthInMinutes);

        for (int index = 0; index < this.events.Count; ++index)
        {
            SynchronizedClock.TimedEvent timedEvent = this.events[index];
            long ticks1 = timedEvent.ticks;
            long ticks2 = SynchronizedClock.Ticks;
            long num2   = (long)((double)timedEvent.delta * num1);
            long num3   = ticks1 / num2 * num2;
            uint num4   = (uint)((ulong)num3 % (ulong)uint.MaxValue);
            int  num5   = (int)SeedRandom.Wanghash(ref num4);
            long num6   = (long)((double)SeedRandom.Range(ref num4, -timedEvent.variance, timedEvent.variance) * num1);
            long num7   = num3 + num2 + num6;
            if (ticks1 < num7 && ticks2 >= num7)
            {
                timedEvent.action(num4);
                timedEvent.ticks = ticks2;
            }
            else if (ticks2 > ticks1 || ticks2 < num3)
            {
                timedEvent.ticks = ticks2;
            }
            this.events[index] = timedEvent;
        }
    }
    public void Tick()
    {
        long   num = (long)10000000;
        double dayLengthInMinutes = 1440 / (double)SynchronizedClock.DayLengthInMinutes;
        double num1 = (double)num * dayLengthInMinutes;

        for (int i = 0; i < this.events.Count; i++)
        {
            SynchronizedClock.TimedEvent item = this.events[i];
            long num2  = item.ticks;
            long ticks = SynchronizedClock.Ticks;
            long num3  = (long)((double)item.delta * num1);
            long num4  = num2 / num3 * num3;
            uint num5  = (uint)(num4 % (ulong)-1);
            SeedRandom.Wanghash(ref num5);
            long num6 = (long)((double)SeedRandom.Range(ref num5, -item.variance, item.variance) * num1);
            long num7 = num4 + num3 + num6;
            if (num2 < num7 && ticks >= num7)
            {
                item.action(num5);
                item.ticks = ticks;
            }
            else if (ticks > num2 || ticks < num4)
            {
                item.ticks = ticks;
            }
            this.events[i] = item;
        }
    }