Beispiel #1
0
        public static EnergyStorage GenerateEnergyStorage(eVehicleType i_VehicleType, eEnergyType i_EnergyType)
        {
            EnergyStorage energyStorage = null;

            switch (i_VehicleType)
            {
            case eVehicleType.Truck:
                energyStorage = new Fuel(k_MaxTruckFuelTankCapacity, Fuel.eFuelType.Soler);
                break;

            case eVehicleType.Car when i_EnergyType == eEnergyType.Fuel:
                energyStorage = new Fuel(k_MaxCarFuelTankCapacity, Fuel.eFuelType.Octan96);
                break;

            case eVehicleType.Car when i_EnergyType == eEnergyType.Electric:
                energyStorage = new Electric(k_MaxCarBatteryCapacity);
                break;

            case eVehicleType.Motorcycle when i_EnergyType == eEnergyType.Fuel:
                energyStorage = new Fuel(k_MaxMotorcycleFuelTankCapacity, Fuel.eFuelType.Octan95);
                break;

            case eVehicleType.Motorcycle when i_EnergyType == eEnergyType.Electric:
                energyStorage = new Electric(k_MaxMotorcycleBatteryCapacity);
                break;
            }

            return(energyStorage);
        }
Beispiel #2
0
 protected Vehicle(string i_ModelName, string i_LicenseNumber, List <Tire> i_Wheels, EnergyStorage i_EnergyStorage, float i_EnergyPercentage)
 {
     r_ModelName        = i_ModelName;
     r_LicenseNumber    = i_LicenseNumber;
     r_Wheels           = i_Wheels;
     r_EnergyStorage    = i_EnergyStorage;
     m_EnergyPercentage = i_EnergyPercentage;
     EnergyStorage.CalculateCurrentAmount(m_EnergyPercentage);
 }
Beispiel #3
0
 public static Car GenerateCar(
     string i_ModelName,
     string i_LicenseNumber,
     List <Tire> i_Wheels,
     EnergyStorage i_EnergyStorage,
     Car.eColor i_Color,
     byte i_NumberOfDoors,
     float i_EnergyPercentage)
 {
     return(new Car(i_Color, i_NumberOfDoors, i_EnergyStorage, i_ModelName, i_LicenseNumber, i_Wheels, i_EnergyPercentage));
 }
Beispiel #4
0
 public Truck(bool i_ContainDangerousMaterials, float i_CargoCapacity, EnergyStorage i_FuelTank, string i_ModelName, string i_LicenseNumber, List <Tire> i_Wheels, float i_EnergyPercentage)
     : base(i_ModelName, i_LicenseNumber, i_Wheels, i_FuelTank, i_EnergyPercentage)
 {
     r_ContainDangerousMaterials = i_ContainDangerousMaterials;
     r_CargoCapacity             = i_CargoCapacity;
 }
Beispiel #5
0
 public override void FillEnergyStorage(float i_Amount, Fuel.eFuelType i_FuelType)
 {
     EnergyStorage.Fill(i_Amount, i_FuelType);
     m_EnergyPercentage = r_EnergyStorage.CalculatePercentage();
 }
Beispiel #6
0
 public override void FillEnergyStorage(float i_Amount)
 {
     EnergyStorage.Fill(i_Amount);
     m_EnergyPercentage = r_EnergyStorage.CalculatePercentage();
 }
Beispiel #7
0
 public Car(eColor i_Color, byte i_NumberOfDoors, EnergyStorage i_EnergyStorage, string i_ModelName, string i_LicenseNumber, List <Tire> i_Wheels, float i_EnergyPercentage)
     : base(i_ModelName, i_LicenseNumber, i_Wheels, i_EnergyStorage, i_EnergyPercentage)
 {
     r_Color         = i_Color;
     r_NumberOfDoors = i_NumberOfDoors;
 }
Beispiel #8
0
 public static Motorcycle GenerateMotorcycle(string i_ModelName, string i_LicenseNumber, List <Tire> i_Wheels, EnergyStorage i_EnergyStorage, Motorcycle.eLicenseType i_LicenseType, int i_EngineCapacity, float i_EnergyPercentage)
 {
     return(new Motorcycle(i_LicenseType, i_EngineCapacity, i_EnergyStorage, i_ModelName, i_LicenseNumber, i_Wheels, i_EnergyPercentage));
 }
Beispiel #9
0
 public static Truck GenerateTruck(string i_ModelName, string i_LicenseNumber, List <Tire> i_Wheels, EnergyStorage i_EnergyStorage, bool i_ContainDangerousMaterials, float i_CargoCapacity, float i_EnergyPercentage)
 {
     return(new Truck(i_ContainDangerousMaterials, i_CargoCapacity, i_EnergyStorage, i_ModelName, i_LicenseNumber, i_Wheels, i_EnergyPercentage));
 }
Beispiel #10
0
 public Motorcycle(eLicenseType i_LicenseType, int i_EngineCapacity, EnergyStorage i_EnergyStorage, string i_ModelName, string i_LicenseNumber, List <Tire> i_Wheels, float i_EnergyPercentage)
     : base(i_ModelName, i_LicenseNumber, i_Wheels, i_EnergyStorage, i_EnergyPercentage)
 {
     r_LicenseType    = i_LicenseType;
     r_EngineCapacity = i_EngineCapacity;
 }