예제 #1
0
 private GeoBlockComplex(GeoBlockMultiLayer block) : base(block.getGeoX(), block.getGeoY())
 {
     _cells = new GeoCell[GeoEngine.GEO_BLOCK_SHIFT * GeoEngine.GEO_BLOCK_SHIFT];
     for (int x = 0, y; x < GeoEngine.GEO_BLOCK_SHIFT; x++)
     {
         for (y = 0; y < GeoEngine.GEO_BLOCK_SHIFT; y++)
         {
             _cells[indexOf(x, y)] = new GeoCellCM(this, block.nGetCellByLayer(x, y, block.nGetLayerCount(x, y) - 1).getHeightAndNSWE(), x, y);
         }
     }
     calcMaxMinHeight();
 }
        private GeoBlockMultiLayer(GeoBlockMultiLayer block) : base(block.getGeoX(), block.getGeoY())
        {
            _cells3D = new GeoCell[GeoEngine.GEO_BLOCK_SHIFT, GeoEngine.GEO_BLOCK_SHIFT][];
            //
            int layers, count = 0;

            for (int x = 0; x < GeoEngine.GEO_BLOCK_SHIFT; x++)
            {
                for (int y = 0; y < GeoEngine.GEO_BLOCK_SHIFT; y++)
                {
                    layers         = block.nGetLayerCount(x, y);
                    count         += layers;
                    _cells3D[x, y] = new GeoCell[layers];
                    while (layers-- > 0)
                    {
                        GeoCell cell = new GeoCellCM(this, block.nGetCellByLayer(x, y, layers).getHeightAndNSWE(), x, y);
                        _cells3D[x, y][layers] = cell;
                    }
                }
            }
            //
            copyCells(count);
            calcMaxMinHeight();
        }