コード例 #1
0
ファイル: Form1.cs プロジェクト: jdalpe/CEBattle
 private void _aidDelBtn2_Click(object sender, EventArgs e)
 {
     _war.RemoveAddOn(true, _aid2Id);
     _aidCB2.Items.RemoveAt(_aid2Id);
     _aid2                     = null;
     _aidName2.Text            = "";
     _aidMole2.Checked         = false;
     _aidTypeCB2.SelectedIndex = 0;
     _aidLevelTB2.Value        = 0;
     _war.ComputeStat();
 }
コード例 #2
0
ファイル: Form1.cs プロジェクト: jdalpe/CEBattle
 private void _aidDelBtn1_Click(object sender, EventArgs e)
 {
     _war.RemoveAddOn(false, _aid1Id);
     _aidCB1.Items.RemoveAt(_aid1Id);
     _aid1                     = null;
     _aidName1.Text            = "";
     _aidMole1.Checked         = false;
     _aidTypeCB1.SelectedIndex = 0;
     _aidLevelTB1.Value        = 0;
     _war.ComputeStat();
 }
コード例 #3
0
ファイル: Form1.cs プロジェクト: jdalpe/CEBattle
        private void _aidAddBtn2_Click(object sender, EventArgs e)
        {
            // Add a AddOn and load some basic information.
            // Also, set the ID on him and modified all in real time
            _aidCB2.Items.Add(Config.NewName);
            _aid2Id = _aidCB2.Items.Count - 1;
            _aidCB2.SelectedIndex = _aid2Id;

            _aid2 = _war.AddAddOn(true, Config.NewName, false, Config.Aids.Moral, Config.AidsLevel.Minimal);


            UpdateComboBoxes();
            _war.ComputeStat();
        }
コード例 #4
0
ファイル: Form1.cs プロジェクト: jdalpe/CEBattle
 private void _aidCB1_SelectedIndexChanged(object sender, EventArgs e)
 {
     // Load an aid by index
     if (_war.GetAddOns(false) == null)
     {
         return;
     }
     // Load a general by index
     _aid1Id = _aidCB1.SelectedIndex;
     if (_aid1Id >= _war.GetAddOns(false).Count)
     {
         return;
     }
     _aid1                     = _war.GetAddOns(false)[_aid1Id];
     _aidName1.Text            = _aid1.Name;
     _aidMole1.Checked         = _aid1.Mole;
     _aidTypeCB1.SelectedIndex = (int)_aid1.Aid;
     _aidLevelTB1.Value        = (int)_aid1.AidsLevel;
 }
コード例 #5
0
ファイル: Form1.cs プロジェクト: jdalpe/CEBattle
 private void _aidCB2_SelectedIndexChanged(object sender, EventArgs e)
 {
     // Load an aid by index
     // Load an aid by index
     if (_war.GetAddOns(true) == null)
     {
         return;
     }
     // Load a general by index
     _aid2Id = _aidCB2.SelectedIndex;
     if (_aid2Id >= _war.GetAddOns(true).Count)
     {
         return;
     }
     _aid2                     = _war.GetAddOns(true)[_aid2Id];
     _aidName2.Text            = _aid2.Name;
     _aidMole2.Checked         = _aid2.Mole;
     _aidTypeCB2.SelectedIndex = (int)_aid2.Aid;
     _aidLevelTB2.Value        = (int)_aid2.AidsLevel;
 }
コード例 #6
0
ファイル: War.cs プロジェクト: jdalpe/CEBattle
        public AddOn AddAddOn(bool side, string name, bool mole, Config.Aids aid,
                              Config.AidsLevel aidsLevel)
        {
            AddOn add = new AddOn(name, mole, aid, aidsLevel);

            if (!side)
            {
                if (_addOn1 == null)
                {
                    _addOn1 = new List <AddOn>();
                }
                _addOn1.Add(add);
            }
            else
            {
                if (_addOn2 == null)
                {
                    _addOn2 = new List <AddOn>();
                }
                _addOn2.Add(add);
            }
            return(add);
        }