public static bool CheckBoring(Vessel vessel, bool msg = false)
 {
     //print(vessel.Landed + ", " + vessel.landedAt + ", " + vessel.launchTime + ", " + vessel.situation + ", " + vessel.orbit.referenceBody.name);
     if ((vessel.orbit.referenceBody.name == "Kerbin") && (vessel.situation == Vessel.Situations.LANDED || vessel.situation == Vessel.Situations.PRELAUNCH || vessel.situation == Vessel.Situations.SPLASHED || vessel.altitude <= vessel.orbit.referenceBody.atmosphereDepth))
     {
         StnSciScenario.Log("in boring place");
         if (msg)
         {
             ScreenMessages.PostScreenMessage(Localizer.Format("#autoLOC_StatSci_screen_boring"), 6, ScreenMessageStyle.UPPER_CENTER);
         }
         return(true);
     }
     return(false);
 }
示例#2
0
 public void Load(ConfigNode node)
 {
     foreach (ConfigNode.Value val in node.values)
     {
         try
         {
             this[val.name] = (TValue)System.Convert.ChangeType(val.value, typeof(TValue));
         }
         catch (Exception e)
         {
             StnSciScenario.LogException(e);
             this[val.name] = default(TValue);
         }
     }
 }
示例#3
0
 public StnSciScenario()
 {
     Instance = this;
     if (settings == null)
     {
         settings = new StnSciSettings();
         foreach (ConfigNode node in GameDatabase.Instance.GetConfigNodes("STN_SCI_SETTINGS"))
         {
             if (!ConfigNode.LoadObjectFromConfig(settings, node))
             {
                 StnSciScenario.Log("Station Science: failed to load settings");
             }
             settings.Load(node);
         }
     }
 }
示例#4
0
 public void Load(ConfigNode node)
 {
     foreach (ConfigNode.Value val in node.values)
     {
         if (!this.ContainsKey(val.name))
         {
             this[val.name] = new HashSet <TValue>();
         }
         try
         {
             this[val.name].UnionWith(parse(val.value));
         }
         catch (Exception e)
         {
             StnSciScenario.LogException(e);
         }
     }
 }
示例#5
0
 public void Save(ConfigNode node)
 {
     StnSciScenario.LogError("CNMap.Save called; not implemented");
 }
示例#6
0
 public float calcReward(float value, bool first_time = false)
 {
     StnSciScenario.Log("calcReward: " + y_intercept + " + " + value + " * " + slope + " * ( " + first_time + " ? " + first_time_multiplier + ")");
     return((y_intercept + value * slope) * (first_time ? first_time_multiplier : 1));
 }
 public void StartExpAction(KSPActionParam p)
 {
     StnSciScenario.Log("in startExperiment(arg)");
     StartExperiment();
 }