示例#1
0
        private void makeAdjusments(int i_EmtyCells, int i_XCells, int i_OCells, int i_SquareAmount)
        {
            if (i_XCells > 0 && i_OCells > 0)
            {
                m_AliveLine = false;
            }

            if (i_EmtyCells > 1)
            {
                m_firstEmptyCell = new Cell(m_LastEmptyCell.Value.Row, m_LastEmptyCell.Value.Col);
                m_LastEmptyCell  = null;
            }

            if (i_XCells == 0 && i_OCells > 0)
            {
                m_Woner = eWonerShip.oMark;
            }
            else if (i_XCells > 0 && i_OCells == 0)
            {
                m_Woner = eWonerShip.xMark;
            }

            if (i_XCells + i_OCells == i_SquareAmount)
            {
                m_FullLine = true;
            }
        }
示例#2
0
 public Line(eDirection i_Direction, int i_Index)
 {
     r_Index     = i_Index;
     r_Direction = i_Direction;
     m_AliveLine = true;
     m_FullLine  = false;
     m_Woner     = eWonerShip.none;
 }
示例#3
0
        public void update(char[,] i_GameBoard)
        {
            this.m_LastEmptyCell  = null;
            this.m_firstEmptyCell = null;
            this.m_Woner          = eWonerShip.none;
            switch (r_Direction)
            {
            case eDirection.Row:
                rowUpdate(i_GameBoard);
                break;

            case eDirection.Col:
                colUpdate(i_GameBoard);
                break;

            case eDirection.SecondaryDiagonal:
                SecondaryDiagonalUpdate(i_GameBoard);
                break;

            case eDirection.MainDiagonal:
                MainDiagonalUpdate(i_GameBoard);
                break;
            }
        }