Ejemplo n.º 1
0
        private void makePlayerMove(PictureBoxBoard i_PictureBoxSelected)
        {
            string move = string.Empty;

            move += Convert.ToChar(i_PictureBoxSelected.Col + 'A');
            move += (i_PictureBoxSelected.Row + 1).ToString();
            m_Game.MakeMove(m_CurrentPlayer, move);
            switchPlayer();
            playGame();
        }
Ejemplo n.º 2
0
        private PictureBoxBoard createPictureBox(int i_Row, int i_Col, int i_Left, int i_Top)
        {
            PictureBoxBoard pictureBoxButton = new PictureBoxBoard();

            pictureBoxButton.Height      = k_PictureBoxSize;
            pictureBoxButton.Width       = k_PictureBoxSize;
            pictureBoxButton.Left        = i_Left;
            pictureBoxButton.Top         = i_Top;
            pictureBoxButton.Row         = i_Row;
            pictureBoxButton.Col         = i_Col;
            pictureBoxButton.SizeMode    = PictureBoxSizeMode.StretchImage;
            pictureBoxButton.BorderStyle = BorderStyle.Fixed3D;
            return(pictureBoxButton);
        }
Ejemplo n.º 3
0
        private void buttonPictureBox_Click(object sender, EventArgs e)
        {
            PictureBoxBoard selectedMove = sender as PictureBoxBoard;

            makePlayerMove(selectedMove);
        }