示例#1
0
 public CarFacade(ICarAccessories accessories, ICarBody body, ICarEngine engine, ICarModel model)
 {
     this.accessories = accessories;
     this.body        = body;
     this.engine      = engine;
     this.model       = model;
 }
        public void Load(ICar car, CarEngineTools t)
        {
            if (car != null && car.Engine != null)
            {
                this.BackColor = Color.Black;

                eng   = car.Engine;
                tools = t;

                _Settings_mode     = 0;
                _Settings_speed    = 0;
                _Settings_throttle = 1;

                this.Invalidate();
                cb_mode.Items.Clear();
                cb_mode.DisplayMember = "mode";
                cb_mode.ValueMember   = "index";
                foreach (KeyValuePair <int, string> mode in car.Engine.EngineModes)
                {
                    cb_mode.Items.Add(new ucSelectModel_EngineCurve_Mode(mode.Key, mode.Value));
                }

                if (cb_mode.Items.Count >= _Settings_mode)
                {
                    cb_mode.SelectedIndex = _Settings_mode;
                }
            }
        }
示例#3
0
        public void ScanEngine()
        {
            if (_files.ContainsKey("Engine") == false)
            {
                string eng = _mHDV.TryGetString("ENGINE", "Normal");
                if (!eng.EndsWith(".ini"))
                {
                    eng += ".ini";
                }

                _files.Add("Engine", rFactor2.Garage.Files.SearchFile(eng));
                // Now we have read the HDV file, we can just as well initialize all sub classes:
                _engine = new rFactor2CarEngine(_files["Engine"], _mHDV);
            }
        }
        public void Load(ICar car, CarEngineTools t)
        {
            if (car != null && car.Engine != null)
            {
                this.BackColor = Color.Black;

                eng = car.Engine;
                tools = t;

                _Settings_mode = 0;
                _Settings_speed = 0;
                _Settings_throttle = 1;

                this.Invalidate();
                cb_mode.Items.Clear();
                cb_mode.DisplayMember = "mode";
                cb_mode.ValueMember = "index";
                foreach (KeyValuePair<int, string> mode in car.Engine.EngineModes)
                {
                    cb_mode.Items.Add(new ucSelectModel_EngineCurve_Mode(mode.Key, mode.Value));
                }

                if (cb_mode.Items.Count >= _Settings_mode)
                    cb_mode.SelectedIndex = _Settings_mode;
            }
        }
示例#5
0
 public Car(ICarEngine engine, ICarWindshield windshield)
 {
     Engine     = engine;
     Windshield = windshield;
 }
示例#6
0
        public void ScanEngine()
        {
            if (_files.ContainsKey("Engine") == false)
            {
                string eng = _mHDV.TryGetString("ENGINE", "Normal");
                if (!eng.EndsWith(".ini"))
                    eng += ".ini";

                if (_files.ContainsKey("Engine")==false)
                _files.Add("Engine",
                           rFactor.Garage.Files.SearchFile(rFactor.Garage.GamedataDirectory, eng));
                // Now we have read the HDV file, we can just as well initialize all sub classes:
                _engine = new rFactorCarEngine(_files["Engine"], _mHDV);
            }
        }
 public Car(string name, ICarEngine carEngine) : base(name, carEngine.GetSpeed())
 {
 }
示例#8
0
 public Client(ICarFactory factory)
 {
     _factory = factory;
     _engine  = _factory.CreateEngine();
     _wheel   = _factory.CreateWheel();
 }
 public CarController(ICarEngine carEngine)
 {
     this.carEngine = carEngine;
 }
示例#10
0
 public CarLogic()
 {
     carEngine = new CarEngine();
 }