Ejemplo n.º 1
0
        private void CheckChoices()
        {
            if (choices[0].CardType == choices[1].CardType)
            {
                for (int i = 0; i < choices.Length; i++)
                {
                    choices[i].Matched = true;
                    choices[i]         = null;
                }
            }

            int tmpCounter = 0;

            foreach (Card card in cards)
            {
                if (card.Matched)
                {
                    tmpCounter++;
                }

                if (tmpCounter == 14)
                {
                    MessageBoxResult r = MessageBox.Show("Do you want to play again?", "Concentration", MessageBoxButton.YesNo);

                    if (r == MessageBoxResult.Yes)
                    {
                        frmConcentration frmConcentration = new frmConcentration();
                        frmConcentration.Show();
                    }
                    this.Close();
                }
            }
        }
Ejemplo n.º 2
0
        private void btnConcentration_Click(object sender, RoutedEventArgs e)
        {
            frmConcentration frmConcentration = new frmConcentration();

            frmConcentration.Show();
        }