示例#1
0
        /*
         *                                                                                      ,,   ,,
         * `7MM"""YMM                             mm       `7MMF'  `7MMF'                        `7MM `7MM
         * MM    `7                             MM         MM      MM                            MM   MM
         * MM   d `7M'   `MF'.gP"Ya `7MMpMMMb.mmMMmm       MM      MM   ,6"Yb. `7MMpMMMb.   ,M""bMM   MM  .gP"Ya `7Mb,od8 ,pP"Ybd
         * MMmmMM   VA   ,V ,M'   Yb  MM    MM  MM         MMmmmmmmMM  8)   MM   MM    MM ,AP    MM   MM ,M'   Yb  MM' "' 8I   `"
         * MM   Y  , VA ,V  8M""""""  MM    MM  MM         MM      MM   ,pm9MM   MM    MM 8MI    MM   MM 8M""""""  MM     `YMMMa.
         * MM     ,M  VVV   YM.    ,  MM    MM  MM         MM      MM  8M   MM   MM    MM `Mb    MM   MM YM.    ,  MM     L.   I8
         * .JMMmmmmMMM   W     `Mbmmd'.JMML  JMML.`Mbmo    .JMML.  .JMML.`Moo9^Yo.JMML  JMML.`Wbmd"MML.JMML.`Mbmmd'.JMML.   M9mmmP'
         */

        /// <summary>
        /// Checks if the guessed letter exists in the current puzzle
        /// </summary>
        private void Letter_Click(object sender, EventArgs e)
        {
            if (!isUsersTurn)
            {
                return;
            }
            var  btn = sender as Button;
            char c   = btn.Text.First();

            btn.Enabled = false;

            if (wheel.MakeGuess(c))
            {
                rightSound.Play();
            }
            else
            {
                wrongSound.Play();
            }

            lbl_PuzzleDisplay.Text = wheel.GetCurrentState();
            UpdatePlayerScores();
            Refresh();
            wheel.NextPlayer();
        }