Ejemplo n.º 1
0
        private void makeGuessRowForTheGame(GuessRow guess, int i_indexOfTheRow, int i_indexOfFirstRow)
        {
            if (i_indexOfTheRow == i_indexOfFirstRow)
            {
                guess.SetEnableOfColorButtons(true);
            }

            else
            {
                guess.SetEnableOfColorButtons(false);
            }

            guess.AfterMakeGuess             += doWhenApplyButtonIsClicked;
            guess.AfterGuessColorButtonClick += setGuessButtonFromColorForm;
        }
Ejemplo n.º 2
0
        private void doWhenApplyButtonIsClicked(string i_Guess, GuessRow io_GuessRow)
        {
            m_Game.PlayTurn(i_Guess);
            Game.eGuessResult[] resultOfTheCurrentTurn = m_Game.getLastGameResult();
            Game.eGameResult    gameResult             = m_Game.GameResult;
            io_GuessRow.interpretResult(resultOfTheCurrentTurn);

            if (gameResult.Equals(Game.eGameResult.Win))
            {
                finishGame(io_GuessRow.ColorButtons);
            }
            else if (gameResult.Equals(Game.eGameResult.StillPlaying))
            {
                m_GameRows[io_GuessRow.IndexOfRow + 1].SetEnableOfColorButtons(true);
            }

            io_GuessRow.SetEnableOfColorButtons(false);
        }