Ejemplo n.º 1
0
        private void OneStep_Click(object sender, EventArgs e)
        {
            UnDo.Enabled    = true;
            button1.Enabled = false;
            Restart.Enabled = true;
            Pause.Enabled   = false;
            Restart.Enabled = true;
            BattleField Battle = BattleField.getBat();

            Battle.DelR();
            ReDo.Enabled = false;
            int i = Battle.DoOne(ArmyA, ArmyB);

            if (i == 1 || i == 2)
            {
                if (i == 1)
                {
                    string s = Battle.WhoWin() + " выиграли!";
                    Battle.NotifyObserverF(s);

                    MessageBox.Show(s, "Win!", MessageBoxButtons.OK);
                }
                else
                {
                    MessageBox.Show("Ничья.", "GameOver!", MessageBoxButtons.OK);
                    Battle.NotifyObserverF("Ничья.");
                }

                Restart.Enabled = true;
                UnDo.Enabled    = false;
                ReDo.Enabled    = false;
                OneStep.Enabled = false;
                Start.Enabled   = false;
                Pause.Enabled   = false;
            }
        }