Esempio n. 1
0
        private void a_btn_addunit_Click(object sender, EventArgs e)
        {
            UnitsForm unitsForm = null;

            if (a_rbt_inf.Checked == true)
            {
                unitsForm = new UnitsForm(PrimalManager, TypesEnums.UnitSide.Ally, TypesEnums.UnitType.Infantry);
            }
            if (a_rbt_cavalerly.Checked == true)
            {
                unitsForm = new UnitsForm(PrimalManager, TypesEnums.UnitSide.Ally, TypesEnums.UnitType.Cavalerly);
            }
            if (a_rbt_arch.Checked == true)
            {
                unitsForm = new UnitsForm(PrimalManager, TypesEnums.UnitSide.Ally, TypesEnums.UnitType.Archers);
            }
            if (!(a_rbt_inf.Checked || a_rbt_cavalerly.Checked || a_rbt_arch.Checked))
            {
                MessageBox.Show("Please, select unit type...");
                return;
            }
            else
            {
                unitsForm.Show();
            }
            unitsForm.FormClosed += (senderr, ee) => {
                refreshBoxes();
            };
        }
Esempio n. 2
0
        private void e_btn_edit_units_Click(object sender, EventArgs e)
        {
            IUnit U = (IUnit)PrimalManager.UnitBoxE.SelectedItem;

            if (U == null)
            {
                return;
            }
            UnitsForm unitsPostionForm = new UnitsForm(PrimalManager, TypesEnums.UnitSide.Enemy, U);

            unitsPostionForm.Show();
            unitsPostionForm.FormClosed += (senderr, ee) => {
                refreshBoxes();
            };
        }