Beispiel #1
0
 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);
     }
 }
Beispiel #2
0
        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);
        }
Beispiel #3
0
        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);
        }
Beispiel #4
0
        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);
            }
        }