MatrixWalk.MatrixRotatingWalk.CheckIfNextCellIsEmpty C# (CSharp) Method

CheckIfNextCellIsEmpty() private method

private CheckIfNextCellIsEmpty ( int row, int col, int directionRow, int directionCol ) : bool
row int
col int
directionRow int
directionCol int
return bool
        private bool CheckIfNextCellIsEmpty(int row, int col, int[] directionRow, int[] directionCol)
        {
            for (int dirIndex = 0; dirIndex < DirectionsCount; dirIndex++)
            {
                int nextRow = row + directionRow[dirIndex];
                int nextCol = col + directionCol[dirIndex];

                if (this.matrix[nextRow, nextCol] == 0)
                {
                    return true;
                }
            }

            return false;
        }