Implement Change Detection Drawing

This commit is contained in:
Marvin Rohrbach
2018-12-15 16:07:03 +01:00
parent e7fda99c11
commit e0a05da06e
5 changed files with 81 additions and 20 deletions

View File

@@ -0,0 +1,20 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace CoopSweeper
{
public static class ArrayHelpers
{
public static T[,] Clone2D<T>(T[,] data) where T : ICloneable<T>
{
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;
}
}
}