Esempio n. 1
0
        public void fromXmlTest()
        {
            XmlDocument doc=new XmlDocument();
            Skill expected = new Skill("Skill",20);
            XmlNode node = expected.toXml(doc);

            Skill actual = new Skill();
            actual.fromXml(node);

            Assert.AreEqual(expected.Value, actual.Value);
        }
Esempio n. 2
0
 public new void fromXml(XmlNode node)
 {
     base.fromXml(node);
     XmlNodeList skillList = ((XmlElement)((XmlElement)node).
         GetElementsByTagName("Governed_Skills").Item(0)).GetElementsByTagName("Skill");
     Skill current;
     foreach (XmlNode skillNode in skillList)
     {
         current = new Skill();
         current.fromXml(skillNode);
         itsSkills.addOrSet(current);
     }
 }
Esempio n. 3
0
        public new void fromXml(XmlNode node)
        {
            base.fromXml(node);

            this.itsName = ((XmlElement)node).
                GetElementsByTagName("Name").Item(0).InnerText;

            XmlNodeList attributeList = ((XmlElement)((XmlElement)node).
                GetElementsByTagName("Attributes").Item(0)).GetElementsByTagName("Attribute");
            Attribute currentAtt;
            foreach (XmlNode attributeNode in attributeList)
            {
                currentAtt = new Attribute();
                currentAtt.fromXml(attributeNode);
                itsAttributes.addOrSet(currentAtt);
            }

            XmlNodeList statList = ((XmlElement)((XmlElement)node).
                GetElementsByTagName("Stats").Item(0)).GetElementsByTagName("Stat");
            Stat currentStat;
            foreach (XmlNode Node in statList)
            {
                currentStat = new Stat();
                currentStat.fromXml(Node);
                itsStats.addOrSet(currentStat);
            }

            XmlNodeList skillList = ((XmlElement)((XmlElement)node).
                 GetElementsByTagName("Skills").Item(0)).GetElementsByTagName("Skill");
            Skill current;
            foreach (XmlNode skillNode in skillList)
            {
                current = new Skill();
                current.fromXml(skillNode);
                itsSkills.addOrSet(current);
            }
        }