protected bool experimentFound(ProtoPartSnapshot part, AvailablePart experiment, CelestialBody targetBody, double contractAccepted) { NE_Helper.log("ProtoVessel recovery: Experiment found"); string moduleName = experimentModulname[experiment.name]; for (int i = 0, count = part.modules.Count; i < count; i++) { var module = part.modules[i]; NE_Helper.log("ProtoVessel recovery Modulename: " + module.moduleName); if (module.moduleName == moduleName) { ConfigNode partConf = module.moduleValues; float completed = NE_Helper.GetValueAsFloat(partConf, OMSExperiment.COMPLETED); if (completed >= contractAccepted) { return(containsDoneExperimentData(partConf, targetBody)); } } } return(false); }
private bool payloadCarrierFound(ProtoPartSnapshot payloadCarrier, AvailablePart experiment, CelestialBody targetBody, double contractAccepted) { NE_Helper.log("ProtoVessel recovery: payload carrier found"); for (int i = 0, count = payloadCarrier.modules.Count; i < count; i++) { var module = payloadCarrier.modules[i]; NE_Helper.log("ProtoVessel recovery Modulename: " + module.moduleName); if (module.moduleName == KIS_CONTAINER) { NE_Helper.log("KIS container found"); ConfigNode partConf = findExperimentModulInPC(module, experiment); if (partConf != null) { NE_Helper.log("Experiment module found"); float completed = NE_Helper.GetValueAsFloat(partConf, OMSExperiment.COMPLETED); if (completed >= contractAccepted) { return(containsDoneExperimentData(partConf, targetBody)); } } } } return(false); }