public override void LoadCustom(ConfigNode node) { id = new Guid(node.GetValue("id")); to = SupplyChainController.getPointByGuid(new Guid(node.GetValue("to"))); node.TryGetValue("maxMass", ref maxMass); /* Load resources. */ ConfigNode[] required = node.GetNodes("RequiredResource"); resourcesRequired = new Dictionary <int, double>(); foreach (ConfigNode rscNode in required) { String name = rscNode.GetValue("name"); double amount = Convert.ToDouble(rscNode.GetValue("amount")); resourcesRequired.Add(PartResourceLibrary.Instance.GetDefinition(name).id, amount); } this.linkVessel.links.Add(this); }
private void loadCommonData(ConfigNode node) { location = SupplyChainController.getPointByGuid(new Guid(node.GetValue("location"))); node.TryGetValue("freestanding", ref this.freestanding); node.TryGetValue("timeRequired", ref timeRequired); node.TryGetValue("active", ref active); if (this.active) { node.TryGetValue("timeAtComplete", ref timeComplete); } /* Load linked vessel. */ Guid linkVesselID = new Guid(node.GetValue("linkVessel")); foreach (VesselData vd in SupplyChainController.instance.trackedVessels) { if (vd.trackingID.Equals(linkVesselID)) { this.linkVessel = vd; break; } } }