public override void OnUnloadVessel()
 {
     //Debug.LogFormat ("[ELVesselWorkNet] OnUnloadVessel {0}", vessel.vesselName);
     protoSinks = new List <ELProtoWorkSink> ();
     for (int i = 0; i < sinks.Count; i++)
     {
         var ps = new ELProtoWorkSink(sinks[i]);
         protoSinks.Add(ps);
         sinks[i] = ps;
     }
 }
 protected override void OnSave(ConfigNode node)
 {
     //Debug.LogFormat ("[ELVesselWorkNet] OnSave {0}", vessel.vesselName);
     node.AddValue("Productivity", Productivity);
     if (vessel.loaded)
     {
         for (int i = 0; i < sinks.Count; i++)
         {
             var ps = new ELProtoWorkSink(sinks[i]);
             ps.Save(node);
         }
     }
     else
     {
         if (protoSinks != null)
         {
             for (int i = 0; i < protoSinks.Count; i++)
             {
                 protoSinks[i].Save(node);
             }
         }
     }
 }
 protected override void OnLoad(ConfigNode node)
 {
     if (node.HasValue("Productivity"))
     {
         string s = node.GetValue("Productivity");
         double p;
         double.TryParse(s, out p);
         Productivity = p;
     }
     sinks      = new List <ELWorkSink> ();
     protoSinks = new List <ELProtoWorkSink> ();
     for (int i = 0; i < node.nodes.Count; i++)
     {
         ConfigNode n = node.nodes[i];
         if (n.name == "WorkSink")
         {
             var sink = new ELProtoWorkSink(n);
             protoSinks.Add(sink);
             sinks.Add(sink);
         }
     }
     // ensure the worknet runs at least once when the vessel is not loaded
     haveWork = true;
 }