Beispiel #1
0
        public void createCar()
        {
            string numberOfDoorsParse;

            this.m_Parametres.TryGetValue("Number Of Doors", out numberOfDoorsParse);
            int numberOfDoors = int.Parse(numberOfDoorsParse);

            string doorColoreParse;

            this.m_Parametres.TryGetValue("Door Color", out doorColoreParse);
            Enum.TryParse <eDoorsColor>(doorColoreParse, out eDoorsColor doorsColor);
            List <Wheel> wheelList = Wheel.CreateWheelList(4, this.m_wheelType);

            m_vehicle = new Car(m_ModelType, wheelList, m_EnergyLeft, m_Engine, doorsColor, numberOfDoors, m_LicenceNum);
        }
Beispiel #2
0
        public void createMotorcycle()
        {
            string engineVolumeParse;

            this.m_Parametres.TryGetValue("Engine Volume", out engineVolumeParse);
            int engineVolume = int.Parse(engineVolumeParse);

            string lisenceTypeParse;

            this.m_Parametres.TryGetValue("License Type", out lisenceTypeParse);
            Enum.TryParse <eLicenseType>(lisenceTypeParse, out eLicenseType lisenceType);
            List <Wheel> wheelList = Wheel.CreateWheelList(2, this.m_wheelType);

            m_vehicle = new Motorcycle(m_ModelType, wheelList, m_EnergyLeft, m_Engine, lisenceType, engineVolume, m_LicenceNum);
        }
        // Create morotcycle
        public void CreateMotorcycle()
        {
            string engineVolumeParse = r_Parametres.Values.ElementAt(m_AmountOfConstParams - 2);
            int    engineVolume      = int.Parse(engineVolumeParse);

            string licenceTypeParse = r_Parametres.Values.ElementAt(m_AmountOfConstParams - 1);

            Enum.TryParse <Motorcycle.eTypeOfLicence>(licenceTypeParse, out Motorcycle.eTypeOfLicence licenceType);

            Wheel        MotorcycleWheel = CreateWheel();
            List <Wheel> wheelList       = Wheel.CreateWheelList(2, MotorcycleWheel);
            Engine       engine          = CreateEngine(m_Enginetype);

            m_Vehicle = new Motorcycle(engineVolume, licenceType, m_ModelType, wheelList, engine, m_EnergyLeft, m_LicenceNumber, r_Parametres);
        }
        // Crate car
        public void CreateCar()
        {
            string numberOfDoorsParse = r_Parametres.Values.ElementAt(m_AmountOfConstParams - 1);
            int    numberOfDoors      = int.Parse(numberOfDoorsParse);

            string carColor = r_Parametres.Values.ElementAt(m_AmountOfConstParams - 2);

            Enum.TryParse <Car.eColorOfCar>(carColor, out Car.eColorOfCar colorOfCar);

            Wheel        CarWheel  = CreateWheel();
            List <Wheel> wheelList = Wheel.CreateWheelList(4, CarWheel);
            Engine       engine    = CreateEngine(m_Enginetype);

            m_Vehicle = new Car(colorOfCar, numberOfDoors, m_ModelType, wheelList, engine, m_EnergyLeft, m_LicenceNumber, r_Parametres);
        }
Beispiel #5
0
        public void createTruck()
        {
            bool   dangerousMaterials;
            string dangerousMaterialsParse;

            this.m_Parametres.TryGetValue("Danguroes Matiriels", out dangerousMaterialsParse);
            dangerousMaterials = dangerousMaterialsParse.ToLower().Equals("true");

            float  cargoVolume;
            string cargoVolumeParse;

            this.m_Parametres.TryGetValue("Cargo Volume", out cargoVolumeParse);
            float.TryParse(cargoVolumeParse, out cargoVolume);

            List <Wheel> wheelList = Wheel.CreateWheelList(12, this.m_wheelType);

            m_vehicle = new Truck(m_ModelType, wheelList, m_EnergyLeft, m_Engine, dangerousMaterials, cargoVolume, m_LicenceNum);
        }
        // Create truck
        public void CreateTruck()
        {
            string isDangerousAsString = r_Parametres.Values.ElementAt(m_AmountOfConstParams - 2);
            bool   isDangerous         = false;

            if (isDangerousAsString == "1")
            {
                isDangerous = true;
            }

            string volumeAsString = r_Parametres.Values.ElementAt(m_AmountOfConstParams - 1);
            float  cargoVolume    = float.Parse(volumeAsString);
            Wheel  truckWheel     = CreateWheel();
            Engine engine         = CreateEngine(m_Enginetype);

            List <Wheel> wheelList = Wheel.CreateWheelList(12, truckWheel);

            m_Vehicle = new Truck(isDangerous, cargoVolume, m_ModelType, wheelList, engine, m_EnergyLeft, m_LicenceNumber, r_Parametres);
        }