public VesselData(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", true); cfg_supply = Lib.ConfigValue(node, "cfg_supply", true); cfg_signal = Lib.ConfigValue(node, "cfg_signal", true); cfg_malfunction = Lib.ConfigValue(node, "cfg_malfunction", true); cfg_storm = Lib.ConfigValue(node, "cfg_storm", true); cfg_script = Lib.ConfigValue(node, "cfg_script", true); cfg_highlights = Lib.ConfigValue(node, "cfg_highlights", true); cfg_showlink = Lib.ConfigValue(node, "cfg_showlink", true); storm_time = Lib.ConfigValue(node, "storm_time", 0.0); storm_age = Lib.ConfigValue(node, "storm_age", 0.0); storm_state = Lib.ConfigValue(node, "storm_state", 0u); group = Lib.ConfigValue(node, "group", "NONE"); computer = node.HasNode("computer") ? new Computer(node.GetNode("computer")) : new Computer(); drive = node.HasNode("drive") ? new Drive(node.GetNode("drive")) : new Drive(); 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)); } }
public Drive(ConfigNode node) { // parse science files files = new Dictionary <string, File>(); if (node.HasNode("files")) { foreach (var file_node in node.GetNode("files").GetNodes()) { files.Add(DB.from_safe_key(file_node.name), new File(file_node)); } } // parse science samples samples = new Dictionary <string, Sample>(); if (node.HasNode("samples")) { foreach (var sample_node in node.GetNode("samples").GetNodes()) { samples.Add(DB.from_safe_key(sample_node.name), new Sample(sample_node)); } } // parse preferred location location = Lib.ConfigValue(node, "location", 0u); }
public KerbalData(ConfigNode node) { rescue = Lib.ConfigValue(node, "rescue", Lib.ConfigValue(node, "resque", true)); //< support pre 1.1.9 typo disabled = Lib.ConfigValue(node, "disabled", false); eva_dead = Lib.ConfigValue(node, "eva_dead", false); rules = new Dictionary <string, RuleData>(); foreach (var rule_node in node.GetNode("rules").GetNodes()) { rules.Add(DB.from_safe_key(rule_node.name), new RuleData(rule_node)); } }