Beispiel #1
0
        private void Load(ConfigNode node)
        {
            msg_signal      = Lib.ConfigValue(node, "msg_signal", false);
            msg_belt        = Lib.ConfigValue(node, "msg_belt", false);
            cfg_ec          = Lib.ConfigValue(node, "cfg_ec", PreferencesMessages.Instance.ec);
            cfg_supply      = Lib.ConfigValue(node, "cfg_supply", PreferencesMessages.Instance.supply);
            cfg_signal      = Lib.ConfigValue(node, "cfg_signal", PreferencesMessages.Instance.signal);
            cfg_malfunction = Lib.ConfigValue(node, "cfg_malfunction", PreferencesMessages.Instance.malfunction);
            cfg_storm       = Lib.ConfigValue(node, "cfg_storm", PreferencesMessages.Instance.storm);
            cfg_script      = Lib.ConfigValue(node, "cfg_script", PreferencesMessages.Instance.script);
            cfg_highlights  = Lib.ConfigValue(node, "cfg_highlights", PreferencesReliability.Instance.highlights);
            cfg_showlink    = Lib.ConfigValue(node, "cfg_showlink", true);
            cfg_show        = Lib.ConfigValue(node, "cfg_show", true);

            deviceTransmit = Lib.ConfigValue(node, "deviceTransmit", true);

            solarPanelsAverageExposure = Lib.ConfigValue(node, "solarPanelsAverageExposure", -1.0);
            scienceTransmitted         = Lib.ConfigValue(node, "scienceTransmitted", 0.0);

            stormData   = new StormData(node.GetNode("StormData"));
            habitatInfo = new VesselHabitatInfo(node.GetNode("SunShielding"));
            computer    = new Computer(node.GetNode("computer"));

            supplies = new Dictionary <string, SupplyData>();
            foreach (var supply_node in node.GetNode("supplies").GetNodes())
            {
                supplies.Add(DB.From_safe_key(supply_node.name), new SupplyData(supply_node));
            }

            scansat_id = new List <uint>();
            foreach (string s in node.GetValues("scansat_id"))
            {
                scansat_id.Add(Lib.Parse.ToUInt(s));
            }

            ConfigNode partsNode = new ConfigNode();

            if (node.TryGetNode("parts", ref partsNode))
            {
                foreach (ConfigNode partDataNode in partsNode.GetNodes())
                {
                    PartData partData;
                    if (parts.TryGetValue(Lib.Parse.ToUInt(partDataNode.name), out partData))
                    {
                        partData.Load(partDataNode);
                    }
                }
            }

            filesTransmitted = new List <File>();
            vesselSituations = new VesselSituations(this);
        }
Beispiel #2
0
        private void FieldsDefaultInit()
        {
            msg_signal      = false;
            msg_belt        = false;
            cfg_ec          = PreferencesMessages.Instance.ec;
            cfg_supply      = PreferencesMessages.Instance.supply;
            cfg_signal      = PreferencesMessages.Instance.signal;
            cfg_malfunction = PreferencesMessages.Instance.malfunction;
            cfg_storm       = PreferencesMessages.Instance.storm;
            cfg_script      = PreferencesMessages.Instance.script;
            cfg_highlights  = PreferencesReliability.Instance.highlights;
            cfg_showlink    = true;
            deviceTransmit  = true;

            stormData        = new StormData(null);
            habitatInfo      = new VesselHabitatInfo(null);
            computer         = new Computer(null);
            supplies         = new Dictionary <string, SupplyData>();
            scansat_id       = new List <uint>();
            filesTransmitted = new List <File>();
            vesselSituations = new VesselSituations(this);
        }