Esempio n. 1
0
 protected virtual void OnGameOver(GameOverArgs e)
 {
     if (GameOver != null)
     {
         GameOver.Invoke(this, e);
     }
 }
Esempio n. 2
0
        private void r_Game_GameOver(object sender, GameOverArgs e)
        {
            string winner = "It's a tie";

            if (e.WhiteTokens != e.BlackTokens)
            {
                winner = string.Format("{0} Won", e.WhiteTokens > e.BlackTokens ? k_White : k_Black);
            }

            string msgToShow = string.Format(
            @"{0}!! ({1}/{2}) ({3}/{4})
            Would you like to play another round?",
            winner,
            e.BlackTokens,
            e.WhiteTokens,
            r_Game.BlackWins,
            r_Game.WhiteWins);
            DialogResult result = MessageBox.Show(msgToShow, "Game Over", MessageBoxButtons.YesNo);
            this.decideIfToPlayAnotherRoundOrNot(result);
        }