using System; using System.Collections.Generic; using System.Text; namespace CoopSweeper { public static class ArrayHelpers { public static T[,] Clone2D(T[,] data) where T : ICloneable { if (data == null) return null; var newArray = new T[data.GetLength(0), data.GetLength(1)]; for (var x = 0; x< data.GetLength(0); x++) for (var y = 0; y < data.GetLength(1); y++) newArray[x,y] = data[x,y].Clone(); return newArray; } } }