protected override void OnParameterLoad(ConfigNode node) { try { base.OnParameterLoad(node); targetBodies = ConfigNodeUtil.ParseValue <List <CelestialBody> >(node, "targetBody", null); biome = ConfigNodeUtil.ParseValue <string>(node, "biome", ""); situation = ConfigNodeUtil.ParseValue <List <Vessel.Situations> >(node, "situation", new List <Vessel.Situations>()); minAltitude = ConfigNodeUtil.ParseValue <float>(node, "minAltitude", float.MinValue); maxAltitude = ConfigNodeUtil.ParseValue <float>(node, "maxAltitude", float.MaxValue); minTerrainAltitude = ConfigNodeUtil.ParseValue <float>(node, "minTerrainAltitude", 0.0f); maxTerrainAltitude = ConfigNodeUtil.ParseValue <float>(node, "maxTerrainAltitude", float.MaxValue); minSpeed = ConfigNodeUtil.ParseValue <double>(node, "minSpeed", 0.0); maxSpeed = ConfigNodeUtil.ParseValue <double>(node, "maxSpeed", double.MaxValue); minRateOfClimb = ConfigNodeUtil.ParseValue <double>(node, "minRateOfClimb", double.MinValue); maxRateOfClimb = ConfigNodeUtil.ParseValue <double>(node, "maxRateOfClimb", double.MaxValue); minAcceleration = ConfigNodeUtil.ParseValue <float>(node, "minAcceleration", 0.0f); maxAcceleration = ConfigNodeUtil.ParseValue <float>(node, "maxAcceleration", float.MaxValue); CreateDelegates(); } finally { ParameterDelegate <Vessel> .OnDelegateContainerLoad(node); } }
protected override void OnParameterLoad(ConfigNode node) { try { base.OnParameterLoad(node); trait = ConfigNodeUtil.ParseValue <string>(node, "trait", (string)null); minExperience = Convert.ToInt32(node.GetValue("minExperience")); maxExperience = Convert.ToInt32(node.GetValue("maxExperience")); minCrew = Convert.ToInt32(node.GetValue("minCrew")); maxCrew = Convert.ToInt32(node.GetValue("maxCrew")); foreach (ConfigNode kerbalNode in node.GetNodes("KERBAL")) { kerbals.Add(Kerbal.Load(kerbalNode)); } foreach (ConfigNode kerbalNode in node.GetNodes("KERBAL_EXCLUDE")) { excludeKerbals.Add(Kerbal.Load(kerbalNode)); } CreateDelegates(); } finally { ParameterDelegate <Vessel> .OnDelegateContainerLoad(node); } }
protected override void OnParameterLoad(ConfigNode node) { try { count = ConfigNodeUtil.ParseValue <int>(node, "count"); index = ConfigNodeUtil.ParseValue <int>(node, "index"); foreach (ConfigNode kerbalNode in node.GetNodes("KERBAL")) { // Legacy support for Contract Configurator 1.8.3 if (kerbalNode.HasValue("kerbal")) { kerbalNode.AddValue("name", kerbalNode.GetValue("kerbal")); } kerbals.Add(Kerbal.Load(kerbalNode)); recovered[kerbals.Last().name] = ConfigNodeUtil.ParseValue <bool>(kerbalNode, "recovered"); } CreateDelegates(); } finally { ParameterDelegate <string> .OnDelegateContainerLoad(node); } }
protected override void OnParameterLoad(ConfigNode node) { try { base.OnParameterLoad(node); situation = ConfigNodeUtil.ParseValue <Vessel.Situations>(node, "situation", Vessel.Situations.ORBITING); minAltitude = ConfigNodeUtil.ParseValue <double>(node, "minAltitude"); maxAltitude = ConfigNodeUtil.ParseValue <double>(node, "maxAltitude", double.MaxValue); minApoapsis = ConfigNodeUtil.ParseValue <double>(node, "minApoapsis"); maxApoapsis = ConfigNodeUtil.ParseValue <double>(node, "maxApoapsis", double.MaxValue); minPeriapsis = ConfigNodeUtil.ParseValue <double>(node, "minPeriapsis"); maxPeriapsis = ConfigNodeUtil.ParseValue <double>(node, "maxPeriapsis", double.MaxValue); minEccentricity = ConfigNodeUtil.ParseValue <double>(node, "minEccentricity"); maxEccentricity = ConfigNodeUtil.ParseValue <double>(node, "maxEccentricity", double.MaxValue); minInclination = ConfigNodeUtil.ParseValue <double>(node, "minInclination"); maxInclination = ConfigNodeUtil.ParseValue <double>(node, "maxInclination", double.MaxValue); minPeriod = ConfigNodeUtil.ParseValue <double>(node, "minPeriod"); maxPeriod = ConfigNodeUtil.ParseValue <double>(node, "maxPeriod", double.MaxValue); targetBody = ConfigNodeUtil.ParseValue <CelestialBody>(node, "targetBody", (CelestialBody)null); displayNotes = ConfigNodeUtil.ParseValue <bool?>(node, "displayNotes", (bool?)false).Value; if (node.HasNode("ORBIT")) { orbit = new OrbitSnapshot(node.GetNode("ORBIT")).Load(); deviationWindow = ConfigNodeUtil.ParseValue <double>(node, "deviationWindow"); } CreateDelegates(); } finally { ParameterDelegate <Vessel> .OnDelegateContainerLoad(node); } }
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); } }
protected override void OnParameterLoad(ConfigNode node) { try { base.OnParameterLoad(node); index = Convert.ToInt32(node.GetValue("index")); count = Convert.ToInt32(node.GetValue("count")); // Legacy support from Contract Configurator 1.8.3 if (node.HasValue("passenger")) { passengers = ConfigNodeUtil.ParseValue <List <string> >(node, "passenger", new List <string>()).Select( name => new Kerbal(name) ).ToList(); } else { foreach (ConfigNode kerbalNode in node.GetNodes("KERBAL")) { passengers.Add(Kerbal.Load(kerbalNode)); } } CreateDelegates(); } finally { ParameterDelegate <Vessel> .OnDelegateContainerLoad(node); } }
protected override void OnParameterLoad(ConfigNode node) { base.OnParameterLoad(node); minCount = Convert.ToInt32(node.GetValue("minCount")); maxCount = Convert.ToInt32(node.GetValue("maxCount")); filters = new List <Filter>(); foreach (ConfigNode child in node.GetNodes("FILTER")) { Filter filter = new Filter(); filter.type = ConfigNodeUtil.ParseValue <ParameterDelegateMatchType>(child, "type"); filter.part = ConfigNodeUtil.ParseValue <AvailablePart>(child, "part", (AvailablePart)null); filter.partModules = child.GetValues("partModule").ToList(); filter.category = ConfigNodeUtil.ParseValue <PartCategories?>(child, "category", (PartCategories?)null); filter.manufacturer = ConfigNodeUtil.ParseValue <string>(child, "manufacturer", (string)null); filter.minCount = ConfigNodeUtil.ParseValue <int>(child, "minCount", 1); filter.maxCount = ConfigNodeUtil.ParseValue <int>(child, "maxCount", int.MaxValue); filters.Add(filter); } ParameterDelegate <Part> .OnDelegateContainerLoad(node); CreateDelegates(); }
protected override void OnParameterLoad(ConfigNode node) { 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 <string>(node, "experiment", ""); recoveryMethod = ConfigNodeUtil.ParseValue <RecoveryMethod>(node, "recoveryMethod"); foreach (ConfigNode child in node.GetNodes("VESSEL_DATA")) { Guid vid = ConfigNodeUtil.ParseValue <Guid>(child, "vessel"); if (vid != null && FlightGlobals.Vessels.Where(v => v.id == vid).Any()) { vesselData[vid] = new VesselData(); foreach (string subject in ConfigNodeUtil.ParseValue <List <string> >(child, "subject", new List <string>())) { vesselData[vid].subjects[subject] = true; } vesselData[vid].recovery = ConfigNodeUtil.ParseValue <bool>(child, "recovery"); } } ParameterDelegate <Vessel> .OnDelegateContainerLoad(node); CreateDelegates(); }
protected override void OnParameterLoad(ConfigNode node) { vessels = ConfigNodeUtil.ParseValue <List <string> >(node, "vessel", new List <string>()); destroyedTargets = ConfigNodeUtil.ParseValue <List <string> >(node, "destroyedTarget", new List <string>()); ParameterDelegate <string> .OnDelegateContainerLoad(node); CreateDelegates(); }
protected override void OnParameterLoad(ConfigNode node) { try { base.OnParameterLoad(node); minCount = Convert.ToInt32(node.GetValue("minCount")); maxCount = Convert.ToInt32(node.GetValue("maxCount")); filters = new List <Filter>(); foreach (ConfigNode child in node.GetNodes("FILTER")) { Filter filter = new Filter(); filter.type = ConfigNodeUtil.ParseValue <ParameterDelegateMatchType>(child, "type"); filter.parts = ConfigNodeUtil.ParseValue <List <AvailablePart> >(child, "part", new List <AvailablePart>()); filter.partModules = child.GetValues("partModule").ToList(); filter.partModuleTypes = child.GetValues("partModuleType").ToList(); filter.category = ConfigNodeUtil.ParseValue <PartCategories?>(child, "category", (PartCategories?)null); filter.manufacturer = ConfigNodeUtil.ParseValue <string>(child, "manufacturer", (string)null); filter.minCount = ConfigNodeUtil.ParseValue <int>(child, "minCount", 1); filter.maxCount = ConfigNodeUtil.ParseValue <int>(child, "maxCount", int.MaxValue); foreach (ConfigNode moduleNode in child.GetNodes("MODULE")) { List <Tuple <string, string, string> > tmp = new List <Tuple <string, string, string> >(); string nextLabel = ""; foreach (ConfigNode.Value v in moduleNode.values) { if (v.name == "name") { tmp.Add(new Tuple <string, string, string>(v.name, "", v.value)); } else if (v.name == "label") { nextLabel = v.value; } else { tmp.Add(new Tuple <string, string, string>(v.name, nextLabel, v.value)); nextLabel = ""; } } filter.partModuleExtended.Add(tmp); } filters.Add(filter); } CreateDelegates(); } finally { ParameterDelegate <Part> .OnDelegateContainerLoad(node); } }
protected override void OnParameterLoad(ConfigNode node) { base.OnParameterLoad(node); count = Convert.ToInt32(node.GetValue("count")); passengers = ConfigNodeUtil.ParseValue <List <ProtoCrewMember> >(node, "passenger", new List <ProtoCrewMember>()); ParameterDelegate <Vessel> .OnDelegateContainerLoad(node); CreateDelegates(); }
protected override void OnParameterLoad(ConfigNode node) { base.OnParameterLoad(node); trait = ConfigNodeUtil.ParseValue <string>(node, "trait", (string)null); minExperience = Convert.ToInt32(node.GetValue("minExperience")); maxExperience = Convert.ToInt32(node.GetValue("maxExperience")); minCrew = Convert.ToInt32(node.GetValue("minCrew")); maxCrew = Convert.ToInt32(node.GetValue("maxCrew")); kerbals = ConfigNodeUtil.ParseValue <List <string> >(node, "kerbal", new List <string>()); ParameterDelegate <Vessel> .OnDelegateContainerLoad(node); CreateDelegates(); }
protected override void OnLoad(ConfigNode node) { base.OnLoad(node); title = node.GetValue("title"); targetBody = ConfigNodeUtil.ParseValue <CelestialBody>(node, "targetBody", (CelestialBody)null); biome = node.GetValue("biome"); situation = ConfigNodeUtil.ParseValue <Vessel.Situations?>(node, "situation", (Vessel.Situations?)null); minAltitude = ConfigNodeUtil.ParseValue <float>(node, "minAltitude"); maxAltitude = ConfigNodeUtil.ParseValue <float>(node, "maxAltitude", float.MaxValue); minSpeed = ConfigNodeUtil.ParseValue <double>(node, "minSpeed"); maxSpeed = ConfigNodeUtil.ParseValue <double>(node, "maxSpeed", Double.MaxValue); ParameterDelegate <Vessel> .OnDelegateContainerLoad(node); CreateDelegates(); }
protected override void OnParameterLoad(ConfigNode node) { count = ConfigNodeUtil.ParseValue <int>(node, "count"); index = ConfigNodeUtil.ParseValue <int>(node, "index"); foreach (ConfigNode childNode in node.GetNodes("KERBAL")) { string kerbal = ConfigNodeUtil.ParseValue <string>(childNode, "kerbal"); kerbals.Add(kerbal); recovered[kerbal] = ConfigNodeUtil.ParseValue <bool>(childNode, "recovered"); } ParameterDelegate <string> .OnDelegateContainerLoad(node); CreateDelegates(); }
protected override void OnParameterLoad(ConfigNode node) { try { define = ConfigNodeUtil.ParseValue <string>(node, "define", null); defineList = ConfigNodeUtil.ParseValue <string>(node, "defineList", null); duration = Convert.ToDouble(node.GetValue("duration")); dissassociateVesselsOnContractFailure = ConfigNodeUtil.ParseValue <bool?>(node, "dissassociateVesselsOnContractFailure", (bool?)true).Value; dissassociateVesselsOnContractCompletion = ConfigNodeUtil.ParseValue <bool?>(node, "dissassociateVesselsOnContractCompletion", (bool?)false).Value; hideVesselName = ConfigNodeUtil.ParseValue <bool?>(node, "hideVesselName", (bool?)false).Value; vesselList = ConfigNodeUtil.ParseValue <List <string> >(node, "vessel", new List <string>()); if (node.HasValue("completionTime")) { waiting = true; completionTime = Convert.ToDouble(node.GetValue("completionTime")); } else { waiting = false; } if (node.HasValue("trackedVessel")) { trackedVesselGuid = new Guid(node.GetValue("trackedVessel")); trackedVessel = FlightGlobals.Vessels.FirstOrDefault(v => v != null && v.id == trackedVesselGuid); if (trackedVessel == null) { trackedVesselGuid = Guid.Empty; } } // Register this early, otherwise we'll miss the event ConfiguredContract.OnContractLoaded.Add(new EventData <ConfiguredContract> .OnEvent(OnContractLoaded)); // Create the parameter delegate for the vessel list CreateVesselListParameter(); } finally { ParameterDelegate <Vessel> .OnDelegateContainerLoad(node); } }
protected override void OnLoad(ConfigNode node) { base.OnLoad(node); title = node.GetValue("title"); minCount = Convert.ToInt32(node.GetValue("minCount")); maxCount = Convert.ToInt32(node.GetValue("maxCount")); filters = new List <Filter>(); // Backwards compatibility from pre 0.5.3 release if (node.HasValue("part") || node.HasValue("partModule") || node.HasValue("category") || node.HasValue("manufacturer")) { Filter filter = new Filter(); filter.type = ConfigNodeUtil.ParseValue <ParameterDelegateMatchType>(node, "type"); filter.part = ConfigNodeUtil.ParseValue <AvailablePart>(node, "part", (AvailablePart)null); filter.partModules = node.GetValues("partModule").ToList(); filter.category = ConfigNodeUtil.ParseValue <PartCategories?>(node, "category", (PartCategories?)null); filter.manufacturer = ConfigNodeUtil.ParseValue <string>(node, "manufacturer", (string)null); filters.Add(filter); } else { foreach (ConfigNode child in node.GetNodes("FILTER")) { Filter filter = new Filter(); filter.type = ConfigNodeUtil.ParseValue <ParameterDelegateMatchType>(child, "type"); filter.part = ConfigNodeUtil.ParseValue <AvailablePart>(child, "part", (AvailablePart)null); filter.partModules = child.GetValues("partModule").ToList(); filter.category = ConfigNodeUtil.ParseValue <PartCategories?>(child, "category", (PartCategories?)null); filter.manufacturer = ConfigNodeUtil.ParseValue <string>(child, "manufacturer", (string)null); filters.Add(filter); } } ParameterDelegate <Part> .OnDelegateContainerLoad(node); CreateDelegates(); }
protected override void OnParameterLoad(ConfigNode node) { try { countMax = ConfigNodeUtil.ParseValue <int>(node, "countMax"); count = ConfigNodeUtil.ParseValue <int>(node, "count"); vesselIdentifier = ConfigNodeUtil.ParseValue <VesselIdentifier>(node, "vesselIdentifier", (VesselIdentifier)null); foreach (ConfigNode kerbalNode in node.GetNodes("KERBAL")) { kerbals.Add(Kerbal.Load(kerbalNode)); } CreateDelegates(); } finally { ParameterDelegate <ProtoCrewMember> .OnDelegateContainerLoad(node); } }
protected override void OnLoad(ConfigNode node) { base.OnLoad(node); title = node.GetValue("title"); minAltitude = ConfigNodeUtil.ParseValue <double>(node, "minAltitude"); maxAltitude = ConfigNodeUtil.ParseValue <double>(node, "maxAltitude", double.MaxValue); minApoapsis = ConfigNodeUtil.ParseValue <double>(node, "minApoapsis"); maxApoapsis = ConfigNodeUtil.ParseValue <double>(node, "maxApoapsis", double.MaxValue); minPeriapsis = ConfigNodeUtil.ParseValue <double>(node, "minPeriapsis"); maxPeriapsis = ConfigNodeUtil.ParseValue <double>(node, "maxPeriapsis", double.MaxValue); minEccentricity = ConfigNodeUtil.ParseValue <double>(node, "minEccentricity"); maxEccentricity = ConfigNodeUtil.ParseValue <double>(node, "maxEccentricity", double.MaxValue); minInclination = ConfigNodeUtil.ParseValue <double>(node, "minInclination"); maxInclination = ConfigNodeUtil.ParseValue <double>(node, "maxInclination", double.MaxValue); minPeriod = ConfigNodeUtil.ParseValue <double>(node, "minPeriod"); maxPeriod = ConfigNodeUtil.ParseValue <double>(node, "maxPeriod", double.MaxValue); targetBody = ConfigNodeUtil.ParseValue <CelestialBody>(node, "targetBody"); ParameterDelegate <Vessel> .OnDelegateContainerLoad(node); CreateDelegates(); }
protected override void OnParameterLoad(ConfigNode node) { try { base.OnParameterLoad(node); capacity = ConfigNodeUtil.ParseValue <bool?>(node, "capacity", (bool?)false).Value; foreach (ConfigNode childNode in node.GetNodes("RESOURCE")) { Filter filter = new Filter(); filter.resource = ConfigNodeUtil.ParseValue <PartResourceDefinition>(childNode, "resource"); filter.minQuantity = ConfigNodeUtil.ParseValue <double>(childNode, "minQuantity"); filter.maxQuantity = ConfigNodeUtil.ParseValue <double>(childNode, "maxQuantity", double.MaxValue); filters.Add(filter); } // Legacy if (node.HasValue("resource")) { Filter filter = new Filter(); filter.resource = ConfigNodeUtil.ParseValue <PartResourceDefinition>(node, "resource"); filter.minQuantity = ConfigNodeUtil.ParseValue <double>(node, "minQuantity"); filter.maxQuantity = ConfigNodeUtil.ParseValue <double>(node, "maxQuantity", double.MaxValue); filters.Add(filter); } CreateDelegates(); } finally { ParameterDelegate <Part> .OnDelegateContainerLoad(node); } }