private Vehicle addElectricMotorCycle(string i_LicenseNumber, string i_Model, string i_ManufacturerName, float i_MaxAirPressure) { string electricMotorCycleData = @"Please enter the following additional information: 1. LicenseType (A,A1,B1,B2) 2. Engine volume"; Console.WriteLine(electricMotorCycleData); MotorCycle.eLicenseType licenseType = (MotorCycle.eLicenseType)Enum.Parse(typeof(MotorCycle.eLicenseType), Console.ReadLine()); int engineVolume = int.Parse(Console.ReadLine()); return(MakeVehicle.MakeElectricMotorCycle(i_Model, i_LicenseNumber, i_ManufacturerName, i_MaxAirPressure, licenseType, engineVolume)); }
private static ElectricMotorcycle makeElectricMotorcycle(List <object> io_ParametersList) { // list order : 0. vehicleType ; 1. i_lisence number ; 2. modelName ; 3. energyLeft ; 4. maxEnergy ; 5. <wheels> ; 6. unique param one. ; 7. unique param two. try { string modelName = (string)io_ParametersList[1]; string lisenceNumber = (string)io_ParametersList[2]; float currentEnergy = (float)io_ParametersList[3]; float maxEnergy = (float)io_ParametersList[4]; LinkedList <Vehicle.Wheel> wheels = (LinkedList <Vehicle.Wheel>)io_ParametersList[5]; MotorCycle.eLicenseType licenseType = (MotorCycle.eLicenseType)io_ParametersList[6]; int motorVolume = (int)io_ParametersList[7]; return(new ElectricMotorcycle(modelName, lisenceNumber, currentEnergy, maxEnergy, Vehicle.eEnergyType.Electric, wheels, licenseType, motorVolume)); } catch (Exception exception) { throw exception; } }
public static Vehicle MakeElectricMotorCycle(string i_Model, string i_LicenseNumber, string i_WheelManufacturerName, float i_WheelMaxAirPressure, MotorCycle.eLicenseType i_LicenseType, int i_EngineVolume) { return(new MotorCycle(i_Model, i_LicenseNumber, i_WheelManufacturerName, i_WheelMaxAirPressure, i_LicenseType, i_EngineVolume, new Battery(k_ElectricMotorCycleMaxBattery))); }
public static Vehicle MakeRegularMotorCycle(string i_Model, string i_LicenseNumber, string i_WheelManufacturerName, float i_WheelMaxAirPressure, MotorCycle.eLicenseType i_LicenseType, int i_EngineVolume) { return(new MotorCycle(i_Model, i_LicenseNumber, i_WheelManufacturerName, i_WheelMaxAirPressure, i_LicenseType, i_EngineVolume, new GasTank(GasTank.eTypeOfFuel.Octan96, k_RegularMotorCycleVolumeGasTank))); }