Ejemplo n.º 1
0
 public static void ReadMissingComponents(this IMySlimBlock Block, Dictionary <string, int> MissingList)
 {
     if (!Block.IsWeldable() && !Block.IsProjectable())
     {
         return;
     }
     if (Block.StockpileAllocated)
     {
         Block.GetMissingComponents(MissingList);
     }
     else
     {
         if (Block.IsFullIntegrity)
         {
             return;
         }
         foreach (var Component in (Block.BlockDefinition as MyCubeBlockDefinition).Components)
         {
             string Name = Component.Definition.Id.SubtypeName;
             if (MissingList.ContainsKey(Name))
             {
                 MissingList[Name] += Component.Count;
             }
             else
             {
                 MissingList.Add(Name, Component.Count);
             }
         }
     }
 }