Esempio n. 1
0
 public Truck(bool i_CooledTrunk, float i_TrunkVolume, List <Tire> i_Tires, Powersource i_Powersource, string i_LicensePlate, string i_ModelName) : base(i_LicensePlate, i_ModelName)
 {
     m_CooledTrunk = i_CooledTrunk;
     m_TrunkVolume = i_TrunkVolume;
     m_Tires       = i_Tires;
     m_Powersource = i_Powersource;
 }
Esempio n. 2
0
 public Motorcycle(int i_EngineVolume, eMotorcycleLicenseType i_LicenseType, List <Tire> i_Tires, Powersource i_Powersource, string i_LicensePlate, string i_ModelName) : base(i_LicensePlate, i_ModelName)
 {
     m_Powersource       = i_Powersource;
     m_Tires             = i_Tires;
     r_EngineVolume      = i_EngineVolume;
     r_MotorcycleLicense = i_LicenseType;
 }
Esempio n. 3
0
 public Car(eCarColor i_CarColor, eCarDoors i_NumOfDoors, List <Tire> i_Tires, Powersource i_Powersource, string i_LicensePlate, string i_ModelName) : base(i_LicensePlate, i_ModelName)
 {
     m_Tires       = i_Tires;
     m_Powersource = i_Powersource;
     m_CarColor    = i_CarColor;
     r_NumOfDoors  = i_NumOfDoors;
 }
Esempio n. 4
0
        public static Vehicle CreateVehicle(string i_LicensePlate, eVehicleType i_VehicleType, string i_ModelName, List <float> i_AirPressure, List <string> i_TireManufacturers, params object[] i_VehicleProperties)
        {
            Vehicle     vehicleCreated = null;
            Powersource sourceOfPower  = null;
            List <Tire> tires          = null;

            if (i_VehicleType == eVehicleType.ElectricCar)
            {
                sourceOfPower  = new Battery(Car.MaxBatteryCharge);
                tires          = CreateTires(i_AirPressure, i_TireManufacturers, Car.NumOfTires, Car.MaxTirePressure);
                vehicleCreated = new Car((Car.eCarColor)i_VehicleProperties[k_FirstVehicleProperty], (Car.eCarDoors)i_VehicleProperties[k_SecondVehicleProperty], tires, sourceOfPower, i_LicensePlate, i_ModelName);
            }
            else if (i_VehicleType == eVehicleType.ElectricMotorcycle)
            {
                sourceOfPower  = new Battery(Motorcycle.MaxBatteryCharge);
                tires          = CreateTires(i_AirPressure, i_TireManufacturers, Motorcycle.NumOfTires, Motorcycle.MaxTirePressure);
                vehicleCreated = new Motorcycle((int)i_VehicleProperties[k_FirstVehicleProperty], (Motorcycle.eMotorcycleLicenseType)i_VehicleProperties[k_SecondVehicleProperty], tires, sourceOfPower, i_LicensePlate, i_ModelName);
            }
            else if (i_VehicleType == eVehicleType.FueledCar)
            {
                sourceOfPower  = new Fuel(Car.MaxFuelTankSize, Fuel.eFuelType.Octan98);
                tires          = CreateTires(i_AirPressure, i_TireManufacturers, Car.NumOfTires, Car.MaxTirePressure);
                vehicleCreated = new Car((Car.eCarColor)i_VehicleProperties[k_FirstVehicleProperty], (Car.eCarDoors)i_VehicleProperties[k_SecondVehicleProperty], tires, sourceOfPower, i_LicensePlate, i_ModelName);
            }
            else if (i_VehicleType == eVehicleType.FueledMotorcycle)
            {
                sourceOfPower  = new Fuel(Motorcycle.MaxFuelTankSize, Fuel.eFuelType.Octan96);
                tires          = CreateTires(i_AirPressure, i_TireManufacturers, Motorcycle.NumOfTires, Motorcycle.MaxTirePressure);
                vehicleCreated = new Motorcycle((int)i_VehicleProperties[k_FirstVehicleProperty], (Motorcycle.eMotorcycleLicenseType)i_VehicleProperties[k_SecondVehicleProperty], tires, sourceOfPower, i_LicensePlate, i_ModelName);
            }
            else if (i_VehicleType == eVehicleType.Truck)
            {
                sourceOfPower  = new Fuel(Truck.MaxFuelTankSize, Fuel.eFuelType.Soler);
                tires          = CreateTires(i_AirPressure, i_TireManufacturers, Truck.NumOfTires, Truck.MaxTirePressure);
                vehicleCreated = new Truck((bool)i_VehicleProperties[k_FirstVehicleProperty], (float)i_VehicleProperties[k_SecondVehicleProperty], tires, sourceOfPower, i_LicensePlate, i_ModelName);
            }

            return(vehicleCreated);
        }