Exemplo n.º 1
0
 public static List<partial_data> PartialData(Vessel v)
 {
   List<partial_data> ret = new List<partial_data>();
   if (v.loaded)
   {
     foreach(var recycler in v.FindPartModulesImplementing<Recycler>())
     {
       var data = new partial_data();
       data.is_enabled = recycler.is_enabled;
       ret.Add(data);
     }
   }
   else
   {
     foreach(ProtoPartSnapshot p in v.protoVessel.protoPartSnapshots)
     {
       foreach(ProtoPartModuleSnapshot m in p.modules)
       {
         if (m.moduleName == "Recycler")
         {
           var data = new partial_data();
           data.is_enabled = Lib.Proto.GetBool(m, "is_enabled");
           ret.Add(data);
         }
       }
     }
   }
   return ret;
 }
Exemplo n.º 2
0
 public static List<partial_data> PartialData(Vessel v)
 {
   List<partial_data> ret = new List<partial_data>();
   if (v.loaded)
   {
     foreach(var greenhouse in v.FindPartModulesImplementing<Greenhouse>())
     {
       var data = new partial_data();
       data.lighting = greenhouse.lighting;
       data.growing = greenhouse.growing;
       data.growth = greenhouse.growth;
       ret.Add(data);
     }
   }
   else
   {
     foreach(ProtoPartSnapshot p in v.protoVessel.protoPartSnapshots)
     {
       foreach(ProtoPartModuleSnapshot m in p.modules)
       {
         if (m.moduleName == "Greenhouse")
         {
           var data = new partial_data();
           data.lighting = Lib.Proto.GetDouble(m, "lighting");
           data.growing = Lib.Proto.GetDouble(m, "growing");
           data.growth = Lib.Proto.GetDouble(m, "growth");
           ret.Add(data);
         }
       }
     }
   }
   return ret;
 }