public static VehicleType GetVehicleTypeOfParkedVehicle(string[] parkingPlace, int position, string registrationNumber) { VehicleType type; type = ParkingSlot.GetVehicleTypeOfParkedVehicle(parkingPlace[position], registrationNumber); return(type); }
/// <summary> /// remove the vehicle /// </summary> /// <param name="parkingSlot"></param> /// <param name="registrationNumber"></param> public static void RemoveVehicle(ref string parkingSlot, string registrationNumber) { VehicleType type = ParkingSlot.GetVehicleTypeOfParkedVehicle(parkingSlot, registrationNumber); if (type == VehicleType.Car) { if (ParkingSlot.GetRegistrationNumber(parkingSlot) == registrationNumber) { // Setting to null tells its empty parkingSlot = null; } else { throw new VehicleNotFoundException(); } } else if (type == VehicleType.Mc) { // Remove Mc RemoveMc(ref parkingSlot, registrationNumber); } }