private void updateRowLine(eRowOrCol i_RowOrColOption, int i_index) { int size = (i_RowOrColOption == eRowOrCol.Col) ? m_GameBoard.Row : m_GameBoard.Col; int i; for (i = 0; i < size; i++) { if (i_RowOrColOption == eRowOrCol.Col) { m_Row[i] = new Position(); m_Row[i].Pos = new Point(i, i_index); m_Row[i].Value = m_GameBoard[i, i_index]; } else { m_Row[i] = new Position(); m_Row[i].Pos = new Point(i_index, i); m_Row[i].Value = m_GameBoard[i_index, i]; } } if (i < m_Row.Length) { m_Row[i] = new Position(); m_Row[i].Value = k_EndRow; } }
// copy the row we want to check to the member array (this row is a line) private void updateRowInBoardArrayFromLine(eRowOrCol i_RowOrColOption, int i_index) { int size = (i_RowOrColOption == eRowOrCol.Col) ? m_GameBoard.Row : m_GameBoard.Col; int i; for (i = 0; i < size; i++) { if (i_RowOrColOption == eRowOrCol.Col) { m_rowInBoard[i] = m_GameBoard[i, i_index]; } else { m_rowInBoard[i] = m_GameBoard[i_index, i]; } } if (i < m_rowInBoard.Length) { m_rowInBoard[i] = k_EndRow; } m_logicSizeArray = i; }