Exemplo n.º 1
0
 public bool AddGrid(MyCubeGrid grid)
 {
     HashSet<Sandbox.Game.Entities.Cube.MySlimBlock> lst = new HashSet<Sandbox.Game.Entities.Cube.MySlimBlock>();
     foreach(var b in grid.GetBlocks())
     {
         if(b.FatBlock is MyCompoundCubeBlock)
         {
             foreach(var subb in (b.FatBlock as MyCompoundCubeBlock).GetBlocks())
             {
                 if (AddBlock(subb))
                     lst.Add(b);
             }
         }
         else
         {
             if (AddBlock(b))
                 lst.Add(b);
         }
     }
     foreach(var b in lst)
     {
         grid.RemoveBlock(b);
     }
     return lst.Count > 0;
     //grid.Close();
 }