game/Extensions/ArrayExtension.cs
/// <summary>
/// Transform 2D array into 2D IEnumerable.
/// </summary>
/// <param name="array">Array to be transformed.</param>
/// <typeparam name="T">Type of array we want to transform.</typeparam>
/// <returns>2D IEnumerable from given array.</returns>
Transform 2D array into 2D IEnumerable.
Transform 2D array into 2D IEnumerable .
public static IEnumerable<IEnumerable<T>> GetAllRows<T>(this T[,] array)
        {
            for (var i = 0; i < array.GetLength(0); i++)
            {
                yield return array.GetRow(i);
            }
        }
public static IEnumerable < IEnumerable < T > > GetAllRows < T > ( this T [ , ] array ) { for ( var i = 0 ; i < array . GetLength ( 0 ) ; i ++ ) { yield return array . GetRow ( i ) ; } }
Transform 2D array into 2D IEnumerable.
Transform 2D array into 2D IEnumerable .
2D IEnumerable from given array.
2D IEnumerable from given array .
T[,]
this
array
Array to be transformed.
Array to be transformed .
typeparam
Type of array we want to transform.
Type of array we want to transform .