protected override void OnParameterLoad(ConfigNode node)
        {
            monolithDiscovered = ConfigNodeUtil.ParseValue <bool>(node, "monolithDiscovered");
            currentState       = ConfigNodeUtil.ParseValue <MonolithState>(node, "currentState");
            starJeb            = ConfigNodeUtil.ParseValue <Vessel>(node, "starJeb", (Vessel)null);
            candidate          = ConfigNodeUtil.ParseValue <Vessel>(node, "candidate", starJeb);
            starJebName        = ConfigNodeUtil.ParseValue <string>(node, "starJebName", "");
            candidateName      = ConfigNodeUtil.ParseValue <string>(node, "candidateName", "");
            if (node.HasValue("velocity.x"))
            {
                float x = ConfigNodeUtil.ParseValue <float>(node, "velocity.x");
                float y = ConfigNodeUtil.ParseValue <float>(node, "velocity.y");
                float z = ConfigNodeUtil.ParseValue <float>(node, "velocity.z");
                velocity = new Vector3(x, y, z);
            }
            if (node.HasNode("PROGRESS_TREE_BACKUP"))
            {
                progressTreeBackup = node.GetNode("PROGRESS_TREE_BACKUP");
            }

            stepTime = Time.fixedTime;

            ParameterDelegate <string> .OnDelegateContainerLoad(node);

            CreateDelegates();
        }
 protected override void OnParameterLoad(ConfigNode node)
 {
     try
     {
         field         = ConfigNodeUtil.ParseValue <RadiationFieldType>(node, "field", RadiationFieldType.UNDEFINED);
         targetBody    = ConfigNodeUtil.ParseValue <CelestialBody>(node, "targetBody", (CelestialBody)null);
         crossings_min = ConfigNodeUtil.ParseValue <int>(node, "crossings_min", 0);
         crossings_max = ConfigNodeUtil.ParseValue <int>(node, "crossings_max", 0);
         title         = ConfigNodeUtil.ParseValue(node, "title", string.Empty);
     }
     finally
     {
         ParameterDelegate <Vessel> .OnDelegateContainerLoad(node);
     }
 }
Exemple #3
0
        protected override void OnParameterLoad(ConfigNode node)
        {
            base.OnParameterLoad(node);
            minRange     = ConfigNodeUtil.ParseValue <double>(node, "minRange");
            maxRange     = ConfigNodeUtil.ParseValue <double>(node, "maxRange", double.MaxValue);
            targetBody   = ConfigNodeUtil.ParseValue <CelestialBody>(node, "targetBody", (CelestialBody)null);
            activeVessel = ConfigNodeUtil.ParseValue <bool>(node, "activeVessel");
            minCount     = ConfigNodeUtil.ParseValue <int>(node, "minCount");
            maxCount     = ConfigNodeUtil.ParseValue <int>(node, "maxCount");
            antennaType  = ConfigNodeUtil.ParseValue <AntennaType?>(node, "antennaType", (AntennaType?)null);

            ParameterDelegate <IAntenna> .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"))
                {
                    HasResource.Filter filter = new HasResource.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"))
                {
                    HasResource.Filter filter = new HasResource.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);
            }
        }