Beispiel #1
0
        private void pointerToAccuracy_Click(object sender, EventArgs e)
        {
            int[] AccuracyCount = new int[2];
            AccuracyCount = Checker.compareGuess(m_GuessButtons, ColorsGenerated);
            for (int i = 0; i < AccuracyCount[0]; i++)
            {
                m_ResultButtons[i].BackColor = Color.Black;
                m_ResultButtons[i].Name      = "Black";
            }

            for (int j = 0; j < AccuracyCount[1]; j++)
            {
                m_ResultButtons[j + AccuracyCount[0]].BackColor = Color.Yellow;
                m_ResultButtons[j + AccuracyCount[0]].Name      = "Yellow";
            }
            if (Checker.AllTrueGuesses(m_ResultButtons))
            {
                WinningForm WinningForm = new WinningForm();
                showSequence(m_GameForm);
                WinningForm.ShowDialog();
            }
            else
            {
                if (Checker.NoMoreGuesses(m_RowNumber, m_Game.m_GameRows.Count))
                {
                    LosingForm losingForm = new LosingForm();
                    Enabler.disableRow(this.m_GuessButtons);
                    showSequence(m_GameForm);
                    losingForm.ShowDialog();
                }
                else
                {
                    this.m_GameForm.m_GameButtons.NextRow(m_RowNumber);         //disable this row and enable next row
                }
            }
        }