Ejemplo n.º 1
0
        //Click event handler for the surrender button
        private void surrenderButton_Click(object sender, EventArgs e)
        {
            gameTimer.Stop();
            countdownTimer.Stop();
            SurrenderPrompt sPrompt = new SurrenderPrompt();

            sPrompt.ShowDialog();
            //If the user confirms surrender, count as lost
            if (sPrompt.selectedChoice == 0)
            {
                Player.tournamentsLost += 1;
                Player.matchLoss       += 1;
                this.Close();
            }
            gameTimer.Start();
            countdownTimer.Start();
        }
Ejemplo n.º 2
0
        //Determines if player wants to surrender
        private void surrenderButton_Click(object sender, EventArgs e)
        {
            //Stop the game
            gameTimer.Stop();
            countdownTimer.Stop();
            SurrenderPrompt sPrompt = new SurrenderPrompt();

            sPrompt.ShowDialog();
            if (sPrompt.selectedChoice == 0)
            {
                //Player surrenders, counts as loss
                Player.matchLoss += 1;
                this.Close();
            }
            gameTimer.Start();
            countdownTimer.Start();
        }