public void CreateCells() { startX = 71; startY = 71; int cellWidth = 32; int cellHeight = 32; _cells = new Cell3[_totalCellRow, _totalCellCol]; _cells2 = new Cell3[_totalCellRow, _totalCellCol]; int x = startX; int y = startY; for (int row1 = 0; row1 < _totalCellRow; row1++) { x = startX; cellXYs = new List<int[]>(); for (int col1 = 0; col1 < _totalCellCol; col1++) { Cell3 cell = new Cell3(x, y, cellWidth, cellHeight); cellXY = new int[] { x, y, 0 }; cellXYs.Add(cellXY); cell._row = row1; cell._col = col1; _cells[row1, col1] = cell; _cells2[row1, col1] = cell.Clone(); x += cellWidth; } cellXYss.Add(cellXYs); y += cellHeight; } }