public static int[,] GetGeneration(int[,] cells, int generation) { var territory = new Territory(); for (int i = 0; i < cells.GetLength(0); i++) { for (int j = 0; j < cells.GetLength(1); j++) { territory.Add(i, j, cells[i, j]); } } for (int i = 0; i < generation; i++) { territory.NextStep(); } return(territory.ToArray()); }