private static void CreateStructCellsThreaded(int cellWidth, int cellHeight, int startX, int startY) { var Cells = new StructGridCell[RowsCount][]; Parallel.For(0, RowsCount, i => { Cells[i] = new StructGridCell[ColumnsCount]; for (int j = 0; j < ColumnsCount; j++) { var coordinate = new StructPoint(startX + cellWidth * j, startY + cellHeight * i); Cells[i][j] = new StructGridCell(cellWidth, cellHeight, coordinate); } }); }
private static void CreateStructCells(int cellWidth, int cellHeight, int startX, int startY) { var Cells = new StructGridCell[RowsCount][]; for (int i = 0; i < RowsCount; i++) { Cells[i] = new StructGridCell[ColumnsCount]; for (int j = 0; j < ColumnsCount; j++) { var coordinate = new StructPoint(startX + cellWidth * j, startY + cellHeight * i); Cells[i][j] = new StructGridCell(cellWidth, cellHeight, coordinate); } } }