public Motorcycle(string i_LicensePlateNumber, VehicleCreator.eVehiclesTypes i_VehicleType) : base(i_LicensePlateNumber) { if (i_VehicleType == VehicleCreator.eVehiclesTypes.ElectricMotorcycle) { m_PowerSource = new Battery(k_MaximumBatteryTime); } else if (i_VehicleType == VehicleCreator.eVehiclesTypes.FuelMotorcycle) { m_PowerSource = new Fuel(k_MaximumAmountOfFuel, k_MotorcycleFuelType); } }
public Vehicle CreateVehicle(string i_LicensePlateNumber, VehicleCreator.eVehiclesTypes i_VehicelType) { Vehicle newVehicle; if (IsVehicleExist(i_LicensePlateNumber)) { throw new ArgumentException("ERROR. The vehicle with license plate number" + i_LicensePlateNumber + "is already exist"); } newVehicle = VehicleCreator.CreateVehicle(i_LicensePlateNumber, i_VehicelType); return(newVehicle); }