Example #1
0
 public void InitializeBoard(int i_RowSize, int i_ColSize)
 {
     for (int row = 0; row < i_RowSize; row++)
     {
         for (int col = 0; col < i_ColSize; col++)
         {
             m_GameBoard[row, col] = new LogicBoardCell();
         }
     }
 }
Example #2
0
        public void InsertMoveToGameBoard(int i_ColInput)
        {
            int            indexOfFirstAvailableRowInInputCol = m_LogicGameBoard.FirstAvailablePoisitionInCol[i_ColInput];
            LogicBoardCell cellToInsert = m_LogicGameBoard.GameBoard[m_LogicGameBoard.RowSize - indexOfFirstAvailableRowInInputCol - 1, i_ColInput];

            if (m_GameStatus == eGameStatus.Player1Turn)
            {
                cellToInsert.CellType = Board.eBoardCellTypes.Circle;
            }
            else
            {
                cellToInsert.CellType = Board.eBoardCellTypes.X;
            }

            m_LogicGameBoard.FirstAvailablePoisitionInCol[i_ColInput]++;
        }
Example #3
0
            public void m_MathcingLogicCell_LogicValueChanged(object sender)
            {
                LogicBoardCell logicBoardCell = sender as LogicBoardCell;

                if (logicBoardCell.CellType == Board.eBoardCellTypes.Circle)
                {
                    this.Text = "O";
                }
                else if (logicBoardCell.CellType == Board.eBoardCellTypes.X)
                {
                    this.Text = "X";
                }
                else
                {
                    this.Text = string.Empty;
                }
            }
Example #4
0
 public MatrixButton(LogicBoardCell i_MatchingLogicCell)
 {
     m_MathcingLogicCell = i_MatchingLogicCell;
     m_MathcingLogicCell.LogicValueChanged += new LogicValueChangeEventHandler(m_MathcingLogicCell_LogicValueChanged);
     InitializeComponent();
 }