示例#1
0
 /// <summary>
 /// Срабатывает при нажатии кнопки Accept.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void buttonAccept_Click(object sender, EventArgs e)
 {
     if (playerHero != null)
     {
         MessageBox.Show("You chose " + playerHero.ToString());
         botHero = ChooseBotHero();
         PlayingDesk playingDesk = new PlayingDesk(playerHero, botHero, "1");
         playingDesk.Show();
         this.Hide();
     }
     else
     {
         MessageBox.Show("Please, choose your hero");
     }
 }
示例#2
0
        private void buttonContinue_Click(object sender, EventArgs e)
        {
            if (!File.Exists("playing-desk.xml"))
            {
                MessageBox.Show("Can't find saved games");
                return;
            }
            List <Hero> heroes      = ReadHeroesFromXml();
            string      roundNumber = GetRoundNumberFromXml();

            if ((heroes == null) || (roundNumber == null))
            {
                return;
            }
            PlayingDesk playingDesk = new PlayingDesk(heroes[0], heroes[1], roundNumber);

            playingDesk.Show();
            this.Hide();
        }