Ejemplo n.º 1
0
 public TacGenericConverter(ConfigNode node, InterestedVessel vessel, ProtoPartModuleSnapshot modulesnapshot, ProtoPartSnapshot partsnapshot)
 {
     this.vessel     = vessel;
     this.PartModule = modulesnapshot;
     if (partsnapshot != null && partsnapshot.partPrefab != null)
     {
         for (int i = 0; i < partsnapshot.partPrefab.Modules.Count; i++)
         {
             BaseConverter           converter    = partsnapshot.partPrefab.Modules[i] as BaseConverter;
             Tac.TacGenericConverter tacConverter = partsnapshot.partPrefab.Modules[i] as Tac.TacGenericConverter;
             if (converter != null && tacConverter != null)
             {
                 inputResList    = converter.inputList;
                 outputResList   = converter.outputList;
                 requiredResList = converter.reqList;
             }
         }
     }
     node.TryGetValue("IsActivated", ref converterIsActive);
 }
 public static bool ResourceConverterGeneratesEC(ProtoPartSnapshot partsnapshot)
 {
     if (partsnapshot != null && partsnapshot.partPrefab != null)
     {
         for (int i = 0; i < partsnapshot.partPrefab.Modules.Count; i++)
         {
             BaseConverter           converter    = partsnapshot.partPrefab.Modules[i] as BaseConverter;
             Tac.TacGenericConverter tacConverter = partsnapshot.partPrefab.Modules[i] as Tac.TacGenericConverter;
             if (converter != null && tacConverter == null)
             {
                 for (int j = 0; j < converter.outputList.Count; j++)
                 {
                     if (converter.outputList[j].ResourceName == "ElectricCharge")
                     {
                         return(true);
                     }
                 }
             }
         }
     }
     return(false);
 }