public override void OnEncodeToConfigNode() { try { Resource_Planetary_Config = masterBodyConfigs.Values.ToList(); } catch (Exception e) { SCANUtil.SCANlog("Error while saving SCANsat altimetry config data: {0}", e); } }
public SCANresourceBody getBodyConfig(int i) { if (masterBodyConfigs.Count >= i) { return(masterBodyConfigs.ElementAt(i).Value); } else { SCANUtil.SCANlog("SCANsat resource celestial body config is empty; something probably went wrong here"); } return(null); }
public SCANresourceBody getBodyConfig(string body, bool warn = true) { if (masterBodyConfigs.ContainsKey(body)) { return(masterBodyConfigs[body]); } else if (warn) { SCANUtil.SCANlog("SCANsat resource celestial body config: [{0}] is empty; something probably went wrong here", body); } return(null); }
public override void OnDecodeFromConfigNode() { resourceType = SCANcontroller.getResourceType(name); sType = resourceType.Type; setDefaultValues(); try { masterBodyConfigs = Resource_Planetary_Config.ToDictionary(a => a.BodyName, a => a); } catch (Exception e) { SCANUtil.SCANlog("Error while loading SCANsat body resource config settings: {0}", e); } }