Ejemplo n.º 1
0
        /// <summary>
        /// generating the buttons which are pressed in order to insert coins
        /// </summary>
        /// <param name="i_NumOfCols"></param>
        private void generateColButtonsArray(int i_NumOfCols)
        {
            for (int colIndex = 0; colIndex < i_NumOfCols; colIndex++)
            {
                ColButton colButtonToGenerate = new ColButton(colIndex);

                colButtonToGenerate.Click += new EventHandler(colButtonToGenerate_Click);
                int ColButtonXLocation = ((colButtonToGenerate.Width + 10) * colIndex) + k_SpaceBetweenButtons;
                colButtonToGenerate.Location = new Point(ColButtonXLocation, 15);
                m_ColButtonsArray[colIndex]  = colButtonToGenerate;
                this.Controls.Add(colButtonToGenerate);
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// event handling of player move(clicking on a col button)
        /// </summary>
        /// <param name="i_colButtonIndex"></param>
        private void colButtonToGenerate_Click(object sender, EventArgs e)
        {
            ColButton clickedButton = sender as ColButton;

            m_GameManager.MakeTurn(clickedButton.ButtonIndex);
        }