コード例 #1
0
        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();
        }
コード例 #2
0
        public CollectScienceCustom(CelestialBody targetBody, string biome, ExperimentSituations?situation, BodyLocation?location,
                                    string experiment, RecoveryMethod recoveryMethod, string title)
            : base(title)
        {
            this.targetBody     = targetBody;
            this.biome          = biome;
            this.situation      = situation;
            this.location       = location;
            this.experiment     = experiment;
            this.recoveryMethod = recoveryMethod;

            CreateDelegates();
        }