Exemple #1
0
        // creates a new button press object passing in each number that matches it's correct color
        // add thems all to the _toggleButtons collection.
        public void buildToggleButtons()
        {
            //clear out the collection of buttons to check.
            _toggleButtons.Clear();
            //create new button press checks passing the correct button and the No. of that button.
            ButtonPress _checkBlack  = new ButtonPress(userInterface._BlackButton, "0");
            ButtonPress _checkRed    = new ButtonPress(userInterface._redButton, "1");
            ButtonPress _checkGreen  = new ButtonPress(userInterface._greenButton, "2");
            ButtonPress _checkBlue   = new ButtonPress(userInterface._BlueButton, "3");
            ButtonPress _checkYellow = new ButtonPress(userInterface._YellowButton, "4");
            ButtonPress _checkOrange = new ButtonPress(userInterface._OrangeButton, "5");

            // add all buttons to btnPressed collection
            _toggleButtons.Add(_checkBlack);
            _toggleButtons.Add(_checkRed);
            _toggleButtons.Add(_checkGreen);
            _toggleButtons.Add(_checkBlue);
            _toggleButtons.Add(_checkYellow);
            _toggleButtons.Add(_checkOrange);
        }
 // build the game start ready button toggle check
 public void buildToggleButton()
 {
     _checkReady = new ButtonPress(_welcomeScreen._readyButton);
 }