Esempio n. 1
0
        private void ParkBus(string registrationNumber, BusAndMotorcycleParameters busAndMotorcycleParameters)
        {
            Bus bus;

            if (VehicleCreator.CreateBus(busAndMotorcycleParameters, out bus))
            {
                if (handler.ParkVehicle(bus))
                {
                    AnnounceParkingSuccess(registrationNumber);
                }
            }
        }
Esempio n. 2
0
        private void ParkMotorcycle(string registrationNumber, BusAndMotorcycleParameters busAndMotorcycleParameters)
        {
            Motorcycle motorcycle;

            if (VehicleCreator.CreateMotorcycle(busAndMotorcycleParameters, out motorcycle))
            {
                if (handler.ParkVehicle(motorcycle))
                {
                    AnnounceParkingSuccess(registrationNumber);
                }
            }
        }
Esempio n. 3
0
        private void ParkBoat(string registrationNumber, string color, int emptyMass)
        {
            Console.Write("Length in meters: ");
            var  length        = GetDecimal(0, 2000);
            var  boatArguments = new Tuple <string, string, int, decimal>(registrationNumber, color, emptyMass, length);
            Boat boat;

            if (VehicleCreator.CreateBoat(boatArguments, out boat))
            {
                if (handler.ParkVehicle(boat))
                {
                    AnnounceParkingSuccess(registrationNumber);
                }
            }
        }
Esempio n. 4
0
        private void ParkAircraft()
        {
            AircraftDTO aircraftDTO = new AircraftDTO();

            PopulateAircraftDTO(aircraftDTO);
            Aircraft aircraft;

            if (VehicleCreator.CreateAircraft(aircraftDTO, out aircraft))
            {
                if (handler.ParkVehicle(aircraft))
                {
                    AnnounceParkingSuccess(aircraft.RegistrationNumber);
                }
            }
        }
Esempio n. 5
0
        private void ParkCar()
        {
            string registrationNumber, color;
            int    emptyMass;

            GetBasicProperties(out registrationNumber, out color, out emptyMass);
            int numberOfWheels = GetNumberOfWheels();

            Console.WriteLine(GetTypeString(propulsionTypes));
            int propulsionType = GetInteger(0, 6);
            var carArgs        = Tuple.Create(registrationNumber, color, emptyMass, numberOfWheels, (CarPropulsionType)propulsionType);
            Car car;

            if (VehicleCreator.CreateCar(carArgs, out car))
            {
                if (handler.ParkVehicle(car))
                {
                    AnnounceParkingSuccess(registrationNumber);
                }
            }
        }