Exemplo n.º 1
0
        public void CarOutGate(Gate gate)
        {
            var vehicle = NotParkedVehicles.FirstOrDefault(v => v.LicensePlate == gate.OpenGatesFor);

            if (vehicle == null)
            {
                return;
            }
            NotParkedVehicles.Remove(vehicle);
            MockedVehiclesInOut.First(veh => veh == vehicle && veh.InParkingLot).OnExit();
        }
Exemplo n.º 2
0
        public Vehicle Parked(string license)
        {
            Vehicle vehicle;

            lock (NotParkedVehicles)
            {
                vehicle = NotParkedVehicles.FirstOrDefault(v => v.LicensePlate == license);
                if (vehicle != null)
                {
                    NotParkedVehicles.Remove(vehicle);
                }
            }
            return(vehicle);
        }
Exemplo n.º 3
0
 public void ArchiveCar(Vehicle vehicle)
 {
     if (!NotParkedVehicles.Remove(vehicle))
     {
         foreach (var parkingLotParkingSpace in ParkingLot.ParkingSpaces)
         {
             if (parkingLotParkingSpace.Vehicle == null)
             {
                 continue;
             }
             if (!parkingLotParkingSpace.Vehicle.Equals(vehicle))
             {
                 continue;
             }
             parkingLotParkingSpace.Vehicle = null;
         }
     }
 }