Exemple #1
0
        public void IncrementMinute()
        {
            _minutes.Add(_main.Dequeue());

            if (_minutes.Count < 5)
            {
                return;
            }
            var minutes = _minutes.Dump();

            _fiveMinutes.Add(minutes.Dequeue());
            while (minutes.Count > 0)
            {
                _main.Enqueue(minutes.Dequeue());
            }

            if (_fiveMinutes.Count < 12)
            {
                return;
            }
            var fives    = _fiveMinutes.Dump();
            int nextHour = fives.Dequeue();

            while (fives.Count > 0)
            {
                _main.Enqueue(fives.Dequeue());
            }

            if (_hours.Count < 11)
            {
                _hours.Add(nextHour);
                return;
            }
            var hours = _hours.Dump();

            while (hours.Count > 0)
            {
                _main.Enqueue(hours.Dequeue());
            }
            _main.Enqueue(nextHour);
        }