Exemplo n.º 1
0
        public Car(Engine.eEnergyType i_EnergyType, string i_ModelName, string i_LiecenseNumber, string i_WheelVendorName, float i_CurrentEnergyInPercent, float i_CurrentAirPressure) : base(i_ModelName, i_LiecenseNumber, i_WheelVendorName, i_CurrentAirPressure, 4)
        {
            if (Wheels[0].CurrentAirPressure > 31f)
            {
                throw new ValueOutOfRangeException(31f, 0);
            }

            Wheels.Capacity = 4;
            foreach (Wheel wheel in Wheels)
            {
                wheel.MaxAirPressure = 31f;
            }

            if (i_EnergyType == Engine.eEnergyType.Electricity)
            {
                VehicleEngine             = new ElectricEngine();
                VehicleEngine.MaxCapacity = 1.8f;
            }
            else if (i_EnergyType == Engine.eEnergyType.Fuel)
            {
                VehicleEngine = new FuelEngine();
                ((FuelEngine)VehicleEngine).FuelType = FuelEngine.eFuelTypes.Octan96;
                VehicleEngine.MaxCapacity            = 55f;
            }

            VehicleEngine.CurrentCapacity = i_CurrentEnergyInPercent * VehicleEngine.MaxCapacity / 100;
            EnergyToEmptyInPrecent        = i_CurrentEnergyInPercent;
        }
Exemplo n.º 2
0
 public FuelMotorCycle(eMotorCycleLicenseType i_LicenseType, int i_EngineCapacity,
                       string i_LicenseNumber, string i_Model /*, i_EnergyLeftPercentage*/)
     : base(i_LicenseType, i_EngineCapacity, i_LicenseNumber, i_Model,
            k_NumOfWheels, k_MaxWheelPressure /*, i_EnergyLeftPercentage*/)
 {
     m_Engine = new FuelEngine(k_FuelType, k_FuelTankCapacity);
 }
Exemplo n.º 3
0
 public FuelCar(eCarColor i_Color, byte i_NumOfDoors, string i_LicenseNumber,
                string i_Model /*, i_EnergyLeftPercentage*/) : base(i_Color,
                                                                    i_NumOfDoors, i_LicenseNumber, i_Model, k_NumOfWheels,
                                                                    k_MaxWheelPressure /*, i_EnergyLeftPercentage*/)
 {
     m_Engine = new FuelEngine(k_FuelType, k_FuelTankCapacity);
 }
Exemplo n.º 4
0
 private FuelEngine.eFuelType getFuelType()
 {
     Console.WriteLine("Please enter fuel type.");
     printEnumList(new FuelEngine.eFuelType());
     FuelEngine.eFuelType fuelType = FuelEngine.CheckFuelType(Console.ReadLine());
     return(fuelType);
 }
Exemplo n.º 5
0
        private void fillFuelTank(string i_LicenseNumber, FuelEngine i_FuelEngine)
        {
            FuelEngine.eFuelType fuelType = getFuelType();

            bool isSuitableFuelType = i_FuelEngine.FuelType == fuelType;

            if (isSuitableFuelType)
            {
                float fuelAddition            = getAmountOfEnergyForAddition(Engine.eEngineType.Fuel);
                float currentFuelInPercentage = i_FuelEngine.CurrentEnergy;
                float currentFuelLiters       = currentFuelInPercentage * i_FuelEngine.MaxEnergyCapacity / 100;

                bool isValidEnergyAddition = currentFuelLiters + fuelAddition < i_FuelEngine.MaxEnergyCapacity;

                if (isValidEnergyAddition)
                {
                    Garage.FillVehicleFuelTank(i_LicenseNumber, fuelType, fuelAddition);

                    printEnergyLoadingMessage(Engine.eEngineType.Fuel, currentFuelInPercentage, i_FuelEngine.CurrentEnergy);
                }
                else
                {
                    Console.WriteLine("The fuel amount you entered is out of range.");
                }
            }
            else
            {
                Console.WriteLine("The fuel type is not suitable to the vehicle's engine.");
            }
        }
        public Motorcycle(
            eVehicle i_TypeOfVehicle,
            string i_ModelName,
            string i_LicenseNumber,
            string i_OwnerPhoneNumber,
            string i_OwnerName,
            string i_WheelManufacturer,
            float i_CurrentAirPressure,
            float i_CurrentCapacity)
            : base(
                i_TypeOfVehicle,
                i_ModelName,
                i_LicenseNumber,
                i_OwnerPhoneNumber,
                i_OwnerName,
                i_WheelManufacturer,
                i_CurrentAirPressure,
                i_CurrentCapacity)
        {
            AddWheels(i_CurrentAirPressure, 2, 30);

            if (i_TypeOfVehicle == eVehicle.ElectricMotorcycle)
            {
                CurrEngine = new ElectricEngine(1.2f);
                CurrEngine.CurrentCapacity = i_CurrentCapacity;
            }
            else
            {
                CurrEngine = new FuelEngine(7, eFuelType.Octane95);
                CurrEngine.CurrentCapacity = i_CurrentCapacity;
            }
        }
Exemplo n.º 7
0
 public FuelTruck(Customer i_Customer, string i_ModelName, string i_LicenseNumber, List <Wheel> i_Wheels,
                  FuelEngine i_FuelEngine, float i_CargoVolume, bool i_DangerousCargo) :
     base(i_Customer, i_ModelName, i_LicenseNumber, i_Wheels, i_FuelEngine)
 {
     this.m_CargoVolume    = i_CargoVolume;
     this.m_DangerousCargo = i_DangerousCargo;
 }
        internal static void RefuelFuelVehicle(string i_VehicleLicenseNumber, FuelEngine.eFuelType i_TypeOfFuel, float i_AmountToFill)
        {
            VehicleInGarage currentVehicle     = ListVehiclesInGarage[i_VehicleLicenseNumber];
            Vehicle         vehicleToAddEnergy = currentVehicle.Vehicle;

            if (vehicleToAddEnergy.EngineOfVehicle.EngineType != Engine.eEngineType.Fuel)
            {
                throw new ArgumentException(string.Format("Invalid input. The type of engine of this vehicle is not Electric{0}", Environment.NewLine));
            }

            FuelEngine fuelEngine = (FuelEngine)vehicleToAddEnergy.EngineOfVehicle;

            try
            {
                fuelEngine.Refuel(i_AmountToFill, i_TypeOfFuel);
                vehicleToAddEnergy.EngineOfVehicle = fuelEngine;
            }
            catch (ArgumentException exception)
            {
                throw exception;
            }
            catch (OutOfRangeException exception)
            {
                throw exception;
            }
        }
Exemplo n.º 9
0
 public FuelTruck(bool i_CarryDangerousChemicals,
                  float i_MaxCarryWeightAllowed, string i_LicenseNumber, string i_Model /*,
                                                                                         * float i_EnergyLeftPercentage*/) : base(i_CarryDangerousChemicals, i_MaxCarryWeightAllowed,
                           i_LicenseNumber, i_Model, k_NumOfWheels, k_MaxWheelPressure /*, i_EnergyLeftPercentage*/)
 {
     m_Engine = new FuelEngine(k_FuelType, k_FuelTankCapacity);
 }
Exemplo n.º 10
0
        private Car CreateNormalCar(string i_VehicleModel, string i_LicensePlate, string i_WheelManufacturer, float i_CurentAirPreasure, float i_CurrentEnergy)
        {
            FuelEngine.eFuelType fuelType          = FuelEngine.eFuelType.Octan98;
            const float          k_MaxTankCapacity = 42f;
            FuelEngine           fuelEngine        = new FuelEngine(fuelType, k_MaxTankCapacity);

            fuelEngine.FuelAddition(fuelType, i_CurrentEnergy);
            Car car = CreateCar(i_VehicleModel, i_LicensePlate, i_WheelManufacturer, fuelEngine, i_CurentAirPreasure);

            return(car);
        }
Exemplo n.º 11
0
        private Motorcycle CreateNormalMotorcycle(string i_VehicleModel, string i_LicensePlate, string i_WheelManufacturer, float i_CurentAirPreasure, float i_CurrentEnergy)
        {
            FuelEngine.eFuelType fuelType          = FuelEngine.eFuelType.Octan95;
            const float          k_maxTankCapacity = 5.5f;
            FuelEngine           fuelEngine        = new FuelEngine(fuelType, k_maxTankCapacity);

            fuelEngine.FuelAddition(fuelType, i_CurrentEnergy);
            Motorcycle motorcycle = CreateMotorcycle(i_VehicleModel, i_LicensePlate, i_WheelManufacturer, fuelEngine, i_CurentAirPreasure);

            return(motorcycle);
        }
Exemplo n.º 12
0
        public void FuelVehicle(string i_LisenceNumber, eFuelTypes i_FuelType, float i_AmountToFill)
        {
            Vehicle    requestedVehicle = null;
            FuelEngine vehicleEngine    = null;

            checkIfVehicleExist(i_LisenceNumber);
            requestedVehicle = m_GarageVehicles[i_LisenceNumber].VehicleEntity;
            checkIfFillable(requestedVehicle, eEngineTypes.FuelVehicle);
            vehicleEngine = requestedVehicle.VehicleEngine as FuelEngine;
            vehicleEngine.FillFuel(i_FuelType, i_AmountToFill);
        }
Exemplo n.º 13
0
        private void putNewFuelTruckInGarage(string i_ModelName, string i_LicenseNumber, float i_PercentageOfEnergyLeft, bool i_IsTheTrunkCooled, float i_TrunkVolume, VehicleInGarage i_VehiclesInGarage, List <Wheel> i_Wheels)
        {
            eFuelType fuelType          = FuelTruck.k_FuelType;
            float     maxFuelInLiter    = FuelTruck.k_MaxFuelInLiter;
            float     currentFuelAmount = inputCurrentFuelAmount(maxFuelInLiter);

            FuelEngine fuelEngine = m_VehicleManufacturer.createNewFuelEngine(fuelType, currentFuelAmount, maxFuelInLiter);
            FuelTruck  fuelTruck  = m_VehicleManufacturer.createNewFuelTruck(fuelEngine, i_ModelName, i_LicenseNumber, i_PercentageOfEnergyLeft, i_IsTheTrunkCooled, i_TrunkVolume, i_Wheels);

            i_VehiclesInGarage.CustomerVehicle = fuelTruck;
            m_Garage.PutANewCarIntoTheGarage(i_VehiclesInGarage);
        }
Exemplo n.º 14
0
        private void putNewFuelCarInGarage(string i_LicenseNumber, string i_ModelName, float i_PercentageOfEnergyLeft, eCarColor carColor, eNumberOfDoors i_NumberOfDoors, VehicleInGarage i_VehicleInGarage, List <Wheel> i_Wheels)
        {
            eFuelType fuelType          = FuelCar.k_FuelType;
            float     maxFuelInLiter    = FuelCar.k_MaxFuelInLiter;
            float     currentFuelAmount = inputCurrentFuelAmount(maxFuelInLiter);

            FuelEngine fuelEngine = m_VehicleManufacturer.createNewFuelEngine(fuelType, currentFuelAmount, maxFuelInLiter);
            FuelCar    fuelCar    = m_VehicleManufacturer.CreateNewFuelCar(fuelEngine, i_NumberOfDoors, carColor, i_ModelName, i_LicenseNumber, i_PercentageOfEnergyLeft, i_Wheels);

            i_VehicleInGarage.CustomerVehicle = fuelCar;
            m_Garage.PutANewCarIntoTheGarage(i_VehicleInGarage);
        }
Exemplo n.º 15
0
        private void putNewFuelEngineMotorcycle(string i_LicenseNumber, string i_ModelName, float i_PercentageOfEnergyLeft, eLicenseType i_LicenseType, int i_EngineCapacity, VehicleInGarage i_VehiclesInGarage, List <Wheel> i_Wheels)
        {
            eFuelType fuelType          = FuelMotorcycle.k_FuelType;
            float     maxFuelInLiter    = FuelMotorcycle.k_MaxFuelInLiter;
            float     currentFuelAmount = inputCurrentFuelAmount(maxFuelInLiter);

            FuelEngine     fuelEngine     = m_VehicleManufacturer.createNewFuelEngine(fuelType, currentFuelAmount, maxFuelInLiter);
            FuelMotorcycle fuelMotorcycle = m_VehicleManufacturer.CreateNewFuelMotorcycle(fuelEngine, i_LicenseType, i_EngineCapacity, i_ModelName, i_LicenseNumber, i_PercentageOfEnergyLeft, i_Wheels);

            i_VehiclesInGarage.CustomerVehicle = fuelMotorcycle;
            m_Garage.PutANewCarIntoTheGarage(i_VehiclesInGarage);
        }
 internal Truck(
     string i_ModelName,
     string i_ModelNumber,
     string i_WheelManufacturerName,
     Registration.eVehiclesType i_Type)
     : base(i_ModelName, i_ModelNumber, i_WheelManufacturerName, i_Type)
 {
     m_Engine = new FuelEngine(Registration.sr_AmountOfResources[i_Type], Registration.sr_ResourceType[i_Type]);
     m_EnergyLeftPercentage = m_AmountOfEnergyLeft / Registration.sr_AmountOfResources[i_Type];
     r_SpecialAttribute     = new List <KeyValuePair <string, Type> >(k_AmountOfSpecialAttribute);
     r_SpecialAttribute.Add(new KeyValuePair <string, Type>("Dangerous cargo", m_Dangerous.GetType()));
     r_SpecialAttribute.Add(new KeyValuePair <string, Type>("Dangerous cargo", m_CargoVolume.GetType()));
 }
Exemplo n.º 17
0
 private void refulVehicle(string i_LicenseNumber)
 {
     if (garage.IsFuelVehicle(i_LicenseNumber))
     {
         IO.PrintList(FuelEngine.getFuelTypes(), "choose the number of the desired fuel type:");
         string fuelTypeToSet     = IO.GetUserOptionChoice(FuelEngine.getFuelTypes().Count);
         string amountOfFuelToAdd = IO.PrintMsgAndGetValue("Please enter the amount of fuel (in liters) to refuel");
         garage.Refuel(i_LicenseNumber, amountOfFuelToAdd, fuelTypeToSet);
     }
     else
     {
         IO.UnMatchingEngineMsg("fuel", i_LicenseNumber);
     }
 }
        internal RegularCar(string i_ModelName, string i_ModelNumber, string i_WheelManufacturerName, Registration.eVehiclesType i_Type)
            : base(i_ModelName, i_ModelNumber, i_WheelManufacturerName, i_Type)
        {
            if (i_Type == Registration.eVehiclesType.ElectricCar)
            {
                m_Engine = new ElectricEngine(Registration.sr_AmountOfResources[i_Type]);
            }
            else
            {
                m_Engine = new FuelEngine(Registration.sr_AmountOfResources[i_Type], Registration.sr_ResourceType[i_Type]);
            }

            m_EnergyLeftPercentage = m_AmountOfEnergyLeft / Registration.sr_AmountOfResources[i_Type];
            r_SpecialAttribute     = new List <KeyValuePair <string, Type> >(k_AmountOfSpecialAttribute)
            {
                new KeyValuePair <string, Type>("Color", m_ColorTypeForRegularCar.GetType()),
                new KeyValuePair <string, Type>("Amount of doors", m_AmountOfDoors.GetType())
            };
        }
Exemplo n.º 19
0
        public Truck(Engine.eEnergyType i_EnergyType, string i_ModelName, string i_LiecenseNumber, string i_WheelVendorName, float i_CurrentEnergyInPercent, float i_CurrentAirPressure) : base(i_ModelName, i_LiecenseNumber, i_WheelVendorName, i_CurrentAirPressure, 12)
        {
            if (Wheels[0].CurrentAirPressure > 26f)
            {
                throw new ValueOutOfRangeException(26f, 0);
            }

            Wheels.Capacity = 12;
            foreach (Wheel wheel in Wheels)
            {
                wheel.MaxAirPressure = 26f;
            }

            VehicleEngine = new FuelEngine();
            ((FuelEngine)VehicleEngine).FuelType = FuelEngine.eFuelTypes.Soler;
            VehicleEngine.MaxCapacity            = 110;
            VehicleEngine.CurrentCapacity        = i_CurrentEnergyInPercent * VehicleEngine.MaxCapacity;
            EnergyToEmptyInPrecent = i_CurrentEnergyInPercent;
        }
Exemplo n.º 20
0
        private Truck CreateTruck(string i_VehicleModel, string i_LicensePlate, string i_WheelManufacturer, float i_CurentAirPressure, float i_CurrentEnergy)
        {
            FuelEngine.eFuelType fuelTypeForTruck      = FuelEngine.eFuelType.Octan96;
            const float          k_MaximumTankCapacity = 135f;

            Wheel[] wheels = new Wheel[k_NumberOfWheelsForTruck];
            for (int i = 0; i < k_NumberOfWheelsForTruck; i++)
            {
                wheels[i] = new Wheel(i_WheelManufacturer, k_mMximumAirPressureForTruck);
                wheels[i].WheelInflation(i_CurentAirPressure);
            }

            FuelEngine fuelEngine = new FuelEngine(fuelTypeForTruck, k_MaximumTankCapacity);

            fuelEngine.FuelAddition(fuelTypeForTruck, i_CurrentEnergy);
            Truck newTruck = new Truck(i_VehicleModel, i_LicensePlate, wheels, fuelEngine);

            return(newTruck);
        }
        public Generic(
            eVehicle i_TypeOfVehicle,
            string i_ModelName,
            string i_LicenseNumber,
            string i_OwnerPhoneNumber,
            string i_OwnerName,
            string i_WheelManufacturer,
            float i_CurrentAirPressure,
            float i_CurrentCapacity,
            float i_MaxAirPressure,
            int i_NumberOfWheels,
            float i_MaxCapacity,
            eFuelType i_FuelType)
            : base(
                i_TypeOfVehicle,
                i_ModelName,
                i_LicenseNumber,
                i_OwnerPhoneNumber,
                i_OwnerName,
                i_WheelManufacturer,
                i_CurrentAirPressure,
                i_CurrentCapacity)
        {
            FuelType = i_FuelType;

            AddWheels(i_CurrentAirPressure, i_NumberOfWheels, i_MaxAirPressure);
            if (i_FuelType == eFuelType.Electric)
            {
                CurrEngine = new ElectricEngine(i_MaxCapacity);
            }
            else
            {
                CurrEngine = new FuelEngine(i_MaxCapacity, m_FuelType);
            }

            CurrEngine.CurrentCapacity = i_CurrentCapacity;
            CurrEngine.MaxCapacity     = i_MaxCapacity;
        }
        internal MotorCycle(
            string i_ModelName,
            string i_ModelNumber,
            string i_WheelManufacturerName,
            Registration.eVehiclesType i_Type)
            : base(i_ModelName, i_ModelNumber, i_WheelManufacturerName, i_Type)
        {
            if (i_Type == Registration.eVehiclesType.ElectricMotorcycle)
            {
                m_Engine = new ElectricEngine(Registration.sr_AmountOfResources[i_Type]);
            }
            else
            {
                m_Engine = new FuelEngine(Registration.sr_AmountOfResources[i_Type], Registration.sr_ResourceType[i_Type]);
            }

            m_EnergyLeftPercentage = m_AmountOfEnergyLeft / Registration.sr_AmountOfResources[i_Type];
            r_SpecialAttribute     = new List <KeyValuePair <string, Type> >(k_AmountOfSpecialAttribute)
            {
                new KeyValuePair <string, Type>("License type", m_MotorCycleLicenseType.GetType()),
                new KeyValuePair <string, Type>("Engine volume", m_EngineVolume.GetType())
            };
        }
Exemplo n.º 23
0
 public Truck(
     eVehicle i_TypeOfVehicle,
     string i_Model_Name,
     string i_LicenseNumber,
     string i_OwnerPhoneNumber,
     string i_OwnerName,
     string i_WheelManufacturer,
     float i_CurrentAirPressure,
     float i_CurrentCapacity)
     : base(
         i_TypeOfVehicle,
         i_Model_Name,
         i_LicenseNumber,
         i_OwnerPhoneNumber,
         i_OwnerName,
         i_WheelManufacturer,
         i_CurrentAirPressure,
         i_CurrentCapacity)
 {
     AddWheels(i_CurrentAirPressure, 16, 28);
     CurrEngine = new FuelEngine(120, eFuelType.Solar);
     CurrEngine.CurrentCapacity = i_CurrentCapacity;
 }
        private float setFuel(Vehicle i_Vehicle)
        {
            FuelEngine.eFuelType fuelType;
            float fuelAmount = 0;

            while (true)
            {
                try
                {
                    FuelEngine fuelEngine = i_Vehicle.Engine as FuelEngine;
                    UserConsole.Print("\nLets fill up Fuel!");
                    fuelType   = (FuelEngine.eFuelType)InputValidation.EnumChoiseToInt(typeof(FuelEngine.eFuelType), UserConsole.ChooseString("fuel type"));
                    fuelAmount = InputValidation.GetFloat("\nEnter amount of fuel you want to fill: ");
                    fuelEngine.FillFuel(fuelType, fuelAmount);
                    break;
                }
                catch (Exception ex)
                {
                    UserConsole.ExceptionOutput(ex);
                }
            }

            return(fuelAmount);
        }
Exemplo n.º 25
0
 public FuelMotorBike(eFuelType i_FuelType, float i_MaxEnergy)
 {
     TypeOfVeichle       = eTypeOfVeichle.FuelMotorCycle;
     Engine              = new FuelEngine(i_FuelType, i_MaxEnergy);
     Engine.TypeOfEngine = eTypeOfEngine.FUEL;
 }
Exemplo n.º 26
0
 public FuelMotorcycle(Customer i_Customer, string i_ModelName, string i_LicenseNumber,
                       List <Wheel> i_Wheels, FuelEngine i_FuelEngine, Enums.eMotorcycleLicenseTypes i_LicenseType, int i_EngineVolume) :
     base(i_Customer, i_ModelName, i_LicenseNumber, i_Wheels, i_FuelEngine, i_LicenseType, i_EngineVolume)
 {
 }
Exemplo n.º 27
0
 // Use this for initialization
 void Start()
 {
     foodEngine = GetComponent<FoodEngine>();
     fuelEngine = GetComponent<FuelEngine>();
     lifeSupportEngine = GetComponent<LifeSupportEngine>();
 }
Exemplo n.º 28
0
        private static void displayAllDetailsOfVehicle(string i_LicensePlateNumber, Garage i_Garage)
        {
            VehicleInGarage requestedVehicle = i_Garage.SearchForVehicleInGarage(i_LicensePlateNumber);

            if (requestedVehicle != null)
            {
                string status       = requestedVehicle.GetVehicleStatusInString();
                bool   isFuelEngine = requestedVehicle.TheVehicle.VehicleEngine is FuelEngine;
                bool   isCar        = requestedVehicle.TheVehicle is Car;
                bool   isMotorCycle = requestedVehicle.TheVehicle is Motorcycle;

                Console.WriteLine(
                    @"License plate number is: {0}
Model name: {1}
Owners name: {2}
Owners Phone number: {3}
Vehicle status: {4}",
                    requestedVehicle.TheVehicle.LicensePlateNumber,
                    requestedVehicle.TheVehicle.ModelName,
                    requestedVehicle.OwnersName,
                    requestedVehicle.OwnnersPhoneNumber,
                    status);

                displayWheelsDetails(requestedVehicle.TheVehicle.VehicleWheels);
                if (isFuelEngine)
                {
                    FuelEngine vehicleEngine = requestedVehicle.TheVehicle.VehicleEngine as FuelEngine;
                    Console.WriteLine(
                        @"Current Amount of fuel: {0}
Fuel Type: {1}",
                        requestedVehicle.TheVehicle.VehicleEngine.CurrentAmountOfEnergy,
                        vehicleEngine.GetFuelTypeInString());
                }
                else
                {
                    ElectricEngine vehicleEngine = requestedVehicle.TheVehicle.VehicleEngine as ElectricEngine;
                    if (vehicleEngine != null)
                    {
                        Console.WriteLine(
                            @"Time left in battery: {0}",
                            vehicleEngine.CurrentAmountOfEnergy);
                    }
                }

                if (isCar)
                {
                    Car vehicleType = requestedVehicle.TheVehicle as Car;
                    if (vehicleType != null)
                    {
                        Console.WriteLine(
                            @"Color: {0}
Number Of Doors: {1}",
                            vehicleType.GetColorInString(),
                            (int)vehicleType.NumbersOfDoors);
                    }
                }
                else if (isMotorCycle)
                {
                    Motorcycle vehicleType = requestedVehicle.TheVehicle as Motorcycle;
                    if (vehicleType != null)
                    {
                        Console.WriteLine(
                            @"License Type: {0}
Engine volume: {1}",
                            vehicleType.GetLicenseTypeInString(),
                            vehicleType.EngineVolume);
                    }
                }
                else
                {
                    Truck vehicleType = requestedVehicle.TheVehicle as Truck;
                    if (vehicleType != null)
                    {
                        string isCooled = "No";
                        if (vehicleType.IsTrankCooled)
                        {
                            isCooled = "YES";
                        }

                        Console.WriteLine(
                            @"Is trunk cooled: {0}
Trunk volume: {1}",
                            isCooled,
                            vehicleType.TrankVolume);
                    }
                }
            }
            else
            {
                Console.WriteLine("vehicle not found");
            }
        }
Exemplo n.º 29
0
 internal FuelMotorcycle(string i_ModelName, string i_LicenceNumber)
     : base(i_ModelName, i_LicenceNumber)
 {
     Engine = new FuelEngine(k_fuelType, k_MaxFuelAmount);
 }
Exemplo n.º 30
0
        public void SetNewProfile( )
        {
            EnergyOfEngine f = new FuelEngine();
            EnergyOfEngine e = new ElectricityEngine();

            UserTypeOfVehicle();
            m_VehicleProfile.NameOfOwner  = ArrayOfInfo[0];
            m_VehicleProfile.PhoneOfOwner = ArrayOfInfo[1];
            if (m_UserVehicleType == GarageEntryOfVehicle.eVehicleType.ElectricyBike || m_UserVehicleType == GarageEntryOfVehicle.eVehicleType.FuelBike)
            {
                if (m_UserVehicleType == GarageEntryOfVehicle.eVehicleType.FuelBike)
                {
                    m_Bike = new Bike(f);
                    m_Bike.m_EnergySource.MaxAmountOfEnergy     = m_Bike.MaxFuelCapacity;
                    m_Bike.m_EnergySource.CurrentAmountOfEnergy = float.Parse(ArrayOfInfo[8]);
                    m_FuelType = FuelEngine.eFuelType.Octan96;
                    m_VehicleProfile.m_Vehicle = SetNewVehicles.CreateVehicle(GarageEntryOfVehicle.eVehicleType.FuelBike);
                    m_Bike.EngineType          = "fuelEngine";
                }
                else
                {
                    m_Bike = new Bike(e);
                    m_Bike.m_EnergySource.MaxAmountOfEnergy     = m_Bike.MaxBatteryHours;
                    m_Bike.m_EnergySource.CurrentAmountOfEnergy = float.Parse(ArrayOfInfo[8]);

                    m_VehicleProfile.m_Vehicle = SetNewVehicles.CreateVehicle(GarageEntryOfVehicle.eVehicleType.ElectricyBike);

                    m_Bike.EngineType = null;
                }

                BikeLicenseType();
                m_VehicleProfile.m_Vehicle = m_Bike;
                m_VehicleProfile.m_Vehicle.WheelsOfVehicle = new Wheel[2];
            }
            if (m_UserVehicleType == GarageEntryOfVehicle.eVehicleType.ElectricyCar || m_UserVehicleType == GarageEntryOfVehicle.eVehicleType.FuelCar)
            {
                if (m_UserVehicleType == GarageEntryOfVehicle.eVehicleType.FuelCar)
                {
                    m_car = new Car(f);
                    m_car.m_EnergySource.MaxAmountOfEnergy     = m_car.MaxFuelCapacity;
                    m_car.m_EnergySource.CurrentAmountOfEnergy = float.Parse(ArrayOfInfo[8]);

                    m_FuelType = FuelEngine.eFuelType.Octan98;
                    m_VehicleProfile.m_Vehicle = SetNewVehicles.CreateVehicle(GarageEntryOfVehicle.eVehicleType.FuelCar);
                    m_car.EngineType           = "fuelEngine";
                }
                else
                {
                    m_car = new Car(e);
                    m_car.m_EnergySource.MaxAmountOfEnergy     = m_car.MaxBatteryHours;
                    m_car.m_EnergySource.CurrentAmountOfEnergy = float.Parse(ArrayOfInfo[8]);

                    m_VehicleProfile.m_Vehicle = SetNewVehicles.CreateVehicle(GarageEntryOfVehicle.eVehicleType.ElectricyCar);
                    m_car.EngineType           = null;
                }

                UserColorOfCar();
                UserDoorsOfCar();
                m_VehicleProfile.m_Vehicle = m_car;
                m_VehicleProfile.m_Vehicle.WheelsOfVehicle = new Wheel[4];
            }
            if (m_UserVehicleType == GarageEntryOfVehicle.eVehicleType.Truck)
            {
                m_VehicleProfile.m_Vehicle = SetNewVehicles.CreateVehicle(GarageEntryOfVehicle.eVehicleType.Truck);
                m_FuelType = FuelEngine.eFuelType.Soler;

                m_Truck = new Truck(f);
                m_Truck.m_EnergySource.MaxAmountOfEnergy     = m_Truck.MaxFuelCapacity;
                m_Truck.m_EnergySource.CurrentAmountOfEnergy = float.Parse(ArrayOfInfo[8]);


                TruckLoadCapacity();
                IsTrunkOfTruckCool();
                m_Truck.LoadCapacity       = int.Parse(ArrayOfInfo[6]);
                m_VehicleProfile.m_Vehicle = m_Truck;
                m_VehicleProfile.m_Vehicle.WheelsOfVehicle = new Wheel[12];
            }

            m_VehicleProfile.m_Vehicle.EnergyInPercentage = float.Parse(ArrayOfInfo[8]);
            m_VehicleProfile.m_Vehicle.VehicleModel       = ArrayOfInfo[2];
            m_VehicleProfile.m_Vehicle.LicenseNumber      = ArrayOfInfo[3];
            m_VehicleProfile.m_Vehicle.SetManufacturerInWheels(ArrayOfInfo[4]);
        }
Exemplo n.º 31
0
 public FuelTruck(string i_ModelName, string i_LicenceNumber)
     : base(i_ModelName, i_LicenceNumber)
 {
     Engine = new FuelEngine(k_fuelType, k_MaxFuelAmount);
 }