예제 #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            SelectWinnerDialog dialog = new SelectWinnerDialog(list[8].Player1, list[8].Player2);

            if (dialog.ShowDialog() == DialogResult.OK)
            {
                list[8].Player1.GamesPlayed++;
                list[8].Player2.GamesPlayed++;
                if (dialog.winner == list[8].Player1)
                {
                    list[8].Player1.GamesWon++;
                    list[8].Player2.GamesLost++;
                }
                else if (dialog.winner == list[8].Player2)
                {
                    list[8].Player2.GamesWon++;
                    list[8].Player1.GamesLost++;
                }

                list[8].GameEnd();
                facade.FreeTable(list[8].TableName, list, 8);
                button1.Hide();
            }
        }