public void FromXML(String XML) { XmlDocument XMLdoc = new XmlDocument(); XMLdoc.LoadXml(XML); XmlNode XMLnode = XMLdoc.DocumentElement; foreach (XmlNode node in XMLnode.ChildNodes) { switch (node.Name) { case "name": Name = node.InnerText; break; case "key": Key = XmlConvert.ToInt32(node.InnerText); break; case "hacksets": this.HackSets = new TFHackSet[node.ChildNodes.Count]; for (int x = 0; x < node.ChildNodes.Count; x++) { HackSets[x] = new TFHackSet(); HackSets[x].FromXML(node.ChildNodes[x].OuterXml); } break; } } }
/// <summary> /// Write an entire HackSet to the Process /// </summary> /// <param name="HackSet">HackSet to write</param> /// <returns>true if successful</returns> public bool WriteHackSet(TFHackSet HackSet) { return WriteHackValues(HackSet.HackValues); }
public TFHack(String Name, int Key, TFHackSet[] HackSets) { this.Name = Name; this.Key = Key; this.HackSets = HackSets; }
public void FromXML(String XML) { XmlDocument XMLdoc = new XmlDocument(); XMLdoc.LoadXml(XML); XmlNode XMLnode = XMLdoc.DocumentElement; foreach (XmlNode node in XMLnode.ChildNodes) { switch(node.Name) { case "name": Name = node.InnerText; break; case "key": Key = XmlConvert.ToInt32(node.InnerText); break; case "hacksets": this.HackSets = new TFHackSet[node.ChildNodes.Count]; for (int x=0; x < node.ChildNodes.Count; x++) { HackSets[x] = new TFHackSet(); HackSets[x].FromXML(node.ChildNodes[x].OuterXml); } break; } } }
/// <summary> /// Write an entire HackSet to the Process /// </summary> /// <param name="HackSet">HackSet to write</param> /// <returns>true if successful</returns> public bool WriteHackSet(TFHackSet HackSet) { return(WriteHackValues(HackSet.HackValues)); }