예제 #1
0
        private void cbEngineType_SelectedIndexChanged(object sender, EventArgs e)
        {
            engineType enType = (engineType)cbEngineType.SelectedItem;

            modelDTO.engineType = enType.engineTypeId;

            if (enType.engineTypeId != 0)
            {
                List <engine> eng = new List <engine>();
                eng.AddRange(enType.engines.ToList());

                if (cbCompany.SelectedIndex != 0)
                {
                    manufacturer m = (manufacturer)cbCompany.SelectedItem;
                    eng.Union(m.engines
                              .Where(o => o.engineType == enType.engineTypeId).ToList());

                    eng = eng.Where(o => o.manufacturer == m.manufacturerId).ToList();

                    if (eng.Count == 0)
                    {
                        cbEngine.Text = "";
                    }
                }

                cbEngine.DataSource = eng;
            }
        }
예제 #2
0
 public Engine(engineType _engine, int _level)
 {
     engine    = _engine;
     level     = _level;
     maxHp     = level;
     currentHp = maxHp;
     maxPwr    = level;
 }
예제 #3
0
 public Engine(engineType _engine, int _level)
 {
     engine = _engine;
     level = _level;
     maxHp = level;
     currentHp = maxHp;
     maxPwr = level;
 }
예제 #4
0
        public void addCarEngineTypes(ComboBox cb)
        {
            engineType all = new engineType();

            all.engineType1  = "все";
            all.engineTypeId = 0;
            List <engineType> objs = new List <engineType>();

            objs.Add(all);
            objs.AddRange(db.engineTypes.ToList());

            cb.DataSource = objs;
        }
예제 #5
0
        private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            int id = Convert.ToInt32(dataGridView1.CurrentRow.Cells["engineTypeIdDataGridViewTextBoxColumn"].Value);

            engineType eng = db.engineTypes.Find(id);

            if (e.ColumnIndex == 2)
            {
                caller.engineType = eng;

                caller.tbType.Text = eng.engineType1;
                caller.typePicked  = true;

                MessageBox.Show("Выбрано " + eng.engineType1);

                this.Close();
            }
        }
예제 #6
0
        /*
         * Quick and dirty non-general function
         * for parsing command line arguments
         */
        public static void Parse(string[] args)
        {
            // defaults
            EngineType      = engineType.vm;
            RunType         = runType.repl;
            EnableBenchmark = false;
            ArgsFileIndex   = 0;

            for (int i = 0; i < args.Length; i++)
            {
                string s = args[i];
                if (s.StartsWith("-engine="))
                {
                    if (s == "-engine=eval")
                    {
                        EngineType = engineType.eval;
                    }

                    EnableBenchmark = true;
                }
                else
                {
                    ArgsFileIndex = i;
                }
            }

            if (EnableBenchmark && args.Length > 1)
            {
                RunType = runType.file;
            }

            if (!EnableBenchmark && args.Length > 0)
            {
                RunType = runType.file;
            }
        }
예제 #7
0
 public Pickup(double NewLoadCapacity, string NewName, int NewNumberOfDoors, engineType NewEngineType) : base(NewName, NewNumberOfDoors)
 {
     this.LoadCapacity  = NewLoadCapacity;
     this.currentEngine = NewEngineType;
 }
예제 #8
0
 public Engine()
 {
     engine = engineType.other;
     level  = -1;
 }
예제 #9
0
 public Engine()
 {
     engine = engineType.other;
     level = -1;
 }