Пример #1
0
 public void UpdateTracker(Vehicle Vehicle_)
 {
     Vehicles.Enqueue(Vehicle_);
     while ((Vehicle_.TimeStamp - Vehicles.Peek().TimeStamp).TotalMinutes >= 1)
     {
         Vehicles.Dequeue();
     }
 }
Пример #2
0
        public void AddVehicle(IVehicle vehicle)
        {
            if (vehicle != null)
            {
                if (IsUniqueVehicle(vehicle))
                {
                    Vehicles.Enqueue(vehicle);
                    Console.WriteLine("Vehicle: {0} added to test queue", vehicle.ID);
                    Console.WriteLine("Shop: {0} vehicles in queue", Vehicles.Count);
                }

                else
                {
                    Console.WriteLine("Error: Shop already has vehicle: {0}", vehicle.ID);
                }
            }
        }