示例#1
0
        private void showResult_Click(object i_Sender, EventArgs i_E)
        {
            //string result = GameLogic.CheckGuessResult(m_PlayerGuess.ToString());
            m_CurrentChoiceRound++;
            changeEnableByRound(m_CurrentChoiceRound);

            // update result buttons:
            int numOfBool = m_GameLogic.GetNumOfBools(this.m_PlayerGuess.ToString());
            int numOfPgia = m_GameLogic.GetNumOfPgia(this.m_PlayerGuess.ToString());

            for (int i = 0; i < numOfBool; i++)
            {
                m_guessResultButtons[m_CurrentChoiceRound - 1][i].BackColor = Color.Black;
            }

            for (int i = 0; i < numOfPgia; i++)
            {
                m_guessResultButtons[m_CurrentChoiceRound - 1][i + numOfBool].BackColor = Color.Yellow;
            }

            if (numOfBool == k_NumOfGuesses)
            {
                ShowComputerResult();
            }

            m_PlayerGuess = new StringBuilder();
        }