public BullsAndCowsLogic()

        {
            m_RandomColors       = new List <Color>();
            m_ColorsToPickWindow = new ColorsPickWindow();
            GetRandomRowOfColors();
        }
        internal void GetRandomRowOfColors()
        {
            m_ColorsToPickWindow = new ColorsPickWindow();
            List <Color> ColorsPaletteList = m_ColorsToPickWindow.ColorsToPick();

            while (m_RandomColors.Count < GameRow.k_WordLength)
            {
                Color nextRandomColor = getRandomColor(ColorsPaletteList);
                if (!m_RandomColors.Contains(nextRandomColor))
                {
                    m_RandomColors.Add(nextRandomColor);
                }
            }
        }
Exemple #3
0
        private void connectButtonsToAction()
        {
            ColorsPickWindow PaletteWindow = m_LogicManger.ColorsToPickWindow;

            foreach (GameRow CurrentGameRow in m_GameWindow.GameRows)
            {
                List <Button> CurrentRowGuesses = CurrentGameRow.GuessesList;
                for (int i = 0; i < CurrentRowGuesses.Count; i++)
                {
                    CurrentRowGuesses[i].Click += PaletteWindow.GuessButton_Click;
                    CurrentRowGuesses[i].Click += enableCurrentAcceptButton;
                }
                CurrentGameRow.AccpetButton.Click += accpetButton_Click;
            }
        }