protected override void OnParameterLoad(ConfigNode node) { try { base.OnParameterLoad(node); targetBody = ConfigNodeUtil.ParseValue <CelestialBody>(node, "targetBody", (CelestialBody)null); biome = ConfigNodeUtil.ParseValue <string>(node, "biome", "").Replace(" ", ""); situation = ConfigNodeUtil.ParseValue <ExperimentSituations?>(node, "situation", (ExperimentSituations?)null); location = ConfigNodeUtil.ParseValue <BodyLocation?>(node, "location", (BodyLocation?)null); experiment = ConfigNodeUtil.ParseValue <List <string> >(node, "experiment", new string[] { "" }.ToList()); recoveryMethod = ConfigNodeUtil.ParseValue <ScienceRecoveryMethod>(node, "recoveryMethod"); List <string> recoveredExp = ConfigNodeUtil.ParseValue <List <string> >(node, "recovery", new List <string>()); foreach (string exp in recoveredExp) { recoveryDone[exp] = true; } CreateDelegates(); } finally { ParameterDelegate <Vessel> .OnDelegateContainerLoad(node); } }
public static string Print(this ScienceRecoveryMethod recoveryMethod) { if (recoveryMethod == ScienceRecoveryMethod.RecoverOrTransmit) { return("Recover or transmit"); } return(recoveryMethod.ToString()); }
public static string Print(this ScienceRecoveryMethod recoveryMethod) { if (recoveryMethod != ScienceRecoveryMethod.Ideal) { return(Localizer.GetStringByTag(StringBuilderCache.Format("#cc.param.CollectScience.rm.{0}", recoveryMethod.ToString()))); } return(recoveryMethod.ToString()); }
public CollectScienceCustom(CelestialBody targetBody, string biome, ExperimentSituations? situation, BodyLocation? location, List<string> experiment, ScienceRecoveryMethod recoveryMethod, string title) : base(title) { lastUpdate = UnityEngine.Time.fixedTime + nextOffset; nextOffset += OFFSET_INCREMENT; nextOffset -= (int)nextOffset; this.targetBody = targetBody; this.biome = biome; this.situation = situation; this.location = location; this.experiment = experiment; this.recoveryMethod = recoveryMethod; disableOnStateChange = true; if (experiment.Count == 0) { experiment.Add(""); } CreateDelegates(); }
public CollectScienceCustom(CelestialBody targetBody, string biome, ExperimentSituations?situation, BodyLocation?location, List <string> experiment, ScienceRecoveryMethod recoveryMethod, string title) : base(title) { lastUpdate = UnityEngine.Time.fixedTime + nextOffset; nextOffset += OFFSET_INCREMENT; nextOffset -= (int)nextOffset; this.targetBody = targetBody; this.biome = biome; this.situation = situation; this.location = location; this.experiment = experiment; this.recoveryMethod = recoveryMethod; disableOnStateChange = true; if (experiment.Count == 0) { experiment.Add(""); } CreateDelegates(); }
protected override void OnParameterLoad(ConfigNode node) { try { base.OnParameterLoad(node); targetBody = ConfigNodeUtil.ParseValue<CelestialBody>(node, "targetBody", (CelestialBody)null); biome = ConfigNodeUtil.ParseValue<string>(node, "biome", ""); situation = ConfigNodeUtil.ParseValue<ExperimentSituations?>(node, "situation", (ExperimentSituations?)null); location = ConfigNodeUtil.ParseValue<BodyLocation?>(node, "location", (BodyLocation?)null); experiment = ConfigNodeUtil.ParseValue<List<string>>(node, "experiment", new string[] { "" }.ToList()); recoveryMethod = ConfigNodeUtil.ParseValue<ScienceRecoveryMethod>(node, "recoveryMethod"); List<string> recoveredExp = ConfigNodeUtil.ParseValue<List<string>>(node, "recovery", new List<string>()); foreach (string exp in recoveredExp) { recoveryDone[exp] = true; } CreateDelegates(); } finally { ParameterDelegate<Vessel>.OnDelegateContainerLoad(node); } }