// -------------------------------------------------------------------- public void LoadGrid(int maxDimension, int serialNumber) { MaxDimension = maxDimension; _mockGrid = null; _grid = new FuelCell[MaxDimension, MaxDimension]; for (int x = 0; x < MaxDimension; x++) { for (int y = 0; y < MaxDimension; y++) { var cell = new FuelCell(x + 1, y + 1, serialNumber); _grid[x, y] = cell; } } }
public FuelGrid(int id, int dimensions) { GridId = id; Dimensions = dimensions; FuelCells = new FuelCell[dimensions][]; //Init fuel cells for (int x = 1; x <= dimensions; x++) { FuelCells[x - 1] = new FuelCell[dimensions]; for (int y = 1; y <= dimensions; y++) { FuelCell cell = new FuelCell(x, y, GridId); FuelCells[x - 1][y - 1] = cell; } } }