Ejemplo n.º 1
0
        private void BuildRequests(string i_LicensePlate, ref bool io_IsElectric)
        {
            // Vehicle vehicle=null;
            Console.Clear();
            Console.WriteLine("Fill the data about the vehicle");
            string vehicleType    = SelectType();
            float  energyRemained = EnergyRemained();

            BuildGeneralRequest(i_LicensePlate, vehicleType, energyRemained);

            if (vehicleType.Equals("truck") == false)
            {
                io_IsElectric = IsElectric();
            }

            if (vehicleType.Equals("car"))
            {
                Doors    numOfDoors = GetNumberOfDoors();
                CarColor carColor   = GetColor();
                m_VehicleType = VehicleType.Car;

                m_VehicleRequest = new CarRequest(carColor, numOfDoors);
            }
            else if (vehicleType.Equals("bike"))
            {
                DrivingLicenceCategory licenseCategory = GetLicenseCategory();
                m_VehicleType = VehicleType.Bike;

                m_VehicleRequest = new BikeRequest(licenseCategory);
            }
            else if (vehicleType.Equals("truck"))
            {
                bool  trunkIsChilled = DoesTheTrunkHaveARefrigerator();
                float trunkVolume    = GetTrunkVolume();
                m_VehicleType = VehicleType.Truck;

                m_VehicleRequest = new TruckRequest(trunkVolume, trunkIsChilled);
            }
            AddWheelsToRequest(m_VehicleType);
        }
Ejemplo n.º 2
0
 public BikeRequest(DrivingLicenceCategory i_LicenceCategory)
 {
     m_LicenceCategory = i_LicenceCategory;
 }