예제 #1
0
 // --------------------------------------------------------------------
 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;
         }
     }
 }
예제 #2
0
        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;
                }
            }
        }