示例#1
0
        private void OnTimeManagerTick(object sender, TickEventArgs tickEventArgs)
        {
            var count = 0;

            while (count++ < _schedule.Flights.Count && IsFlightHappend(tickEventArgs))
            {
                FlightHappend(_schedule.Flights[_nextFlightIndex]);
                _nextFlightIndex = GetNextIndex(_nextFlightIndex);
            }
            _lastTime = tickEventArgs.Time;
        }
示例#2
0
        private bool IsFlightHappend(TickEventArgs tickEventArgs)
        {
            var time = _schedule.Flights[_nextFlightIndex].Time;

            return(time >= _lastTime && time <= tickEventArgs.Time || tickEventArgs.Time < _lastTime && (time >= _lastTime || time <= tickEventArgs.Time));
        }
示例#3
0
 protected virtual void OnTick(TickEventArgs e)
 {
     Tick?.Invoke(this, e);
 }