Example #1
0
        /// <summary>
        /// Allows you to change the pokemon that was defeated.
        /// </summary>
        /// <param name="p">Pokemon to change.</param>
        private void ChangeDeadPokemon(Pokemon p)
        {
            WriteMessage("Pokemon " + p.Name + " died!");
            UpdateGraphics();

            if (!_game.ChangePokemon())
            {
                if (MessageBox.Show("Player " + ((_game.IsRoundPlayer1) ? "2" : "1") + " win! \n Do you want restart?", "End game",
                                    MessageBoxButtons.YesNo, MessageBoxIcon.Information) == DialogResult.Yes)
                {
                    _game.Restart();
                }
                else
                {
                    _game.Exit();
                }
            }
        }