Esempio n. 1
0
        public async Task StartWaitingInStationAsync(int delayInMS)
        {
            if (delayInMS < 0)
            {
                throw new ArgumentOutOfRangeException(nameof(delayInMS), "Delay time cannot be negative!");
            }
            logger.LogInformation($"Flight {Flight.Id} started waiting.");
            IsReadyToContinue = false;
            await Task.Delay(delayInMS);

            IsReadyToContinue = true;
            ReadyToContinue?.Invoke(this, EventArgs.Empty);
            logger.LogInformation($"Flight {Flight.Id} finished waiting and is ready to move.");
        }
 public void StopWaiting()
 {
     ReadyToContinue?.Invoke(this, EventArgs.Empty);
     IsReadyToContinue = true;
 }