Exemplo n.º 1
0
        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;
                }
            }
        }
Exemplo n.º 2
0
 /// <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);
 }
Exemplo n.º 3
0
 public TFHack(String Name, int Key, TFHackSet[] HackSets)
 {
     this.Name = Name;
     this.Key = Key;
     this.HackSets = HackSets;
 }
Exemplo n.º 4
0
 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;
         }
     }
 }
Exemplo n.º 5
0
 /// <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));
 }