Beispiel #1
0
        private void placeCheckGuessButton(int i_TurnNumber, int i_SpaceBetweenTurnsAndButtons)
        {
            int baseHeightFromForm    = 90;
            int baseLeftSpaceFromform = 200;
            int buttonMeasurement     = 40;

            m_CheckGuessButton = new CheckGuessButton((i_TurnNumber * i_SpaceBetweenTurnsAndButtons) + baseHeightFromForm, baseLeftSpaceFromform, buttonMeasurement, buttonMeasurement / 2);
        }
Beispiel #2
0
 public Turn(int i_numberOfColorsTheUserGuesses, int i_TurnNumber)
 {
     m_TurnNumber = i_TurnNumber;
     m_NumberOfColorsTheUserGuesses = i_numberOfColorsTheUserGuesses;
     m_UserGuess        = new ColoredGameButton[m_NumberOfColorsTheUserGuesses];
     m_CheckGuessButton = new CheckGuessButton();
     m_UserFeedback     = new ColoredGameButton[m_NumberOfColorsTheUserGuesses];
     FormGameManager.m_GameWonOnThisTurn += this.Game_Won;
 }
Beispiel #3
0
        private void checkGuessButton_Clicked(object sender, EventArgs e)
        {
            CheckGuessButton clickedCheckGuessButton = (CheckGuessButton)sender;

            // We want to check in which turn was the pressed button included in
            for (int i = 0; i < m_Turns.Length; i++)
            {
                int turnNumberOfButton = m_Turns[i].GetTurnNumberOfButton(clickedCheckGuessButton);
                if (turnNumberOfButton != -1)
                {
                    OnCheckGuess(turnNumberOfButton);
                    break;
                }
            }
        }