Beispiel #1
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);
            }
        }
Beispiel #2
0
        public new void fromXml(XmlNode node)
        {
            base.fromXml(node);
            XmlNodeList attributeList = ((XmlElement)((XmlElement)node).
                GetElementsByTagName("Governing_Attributes").Item(0)).GetElementsByTagName("Attribute");
            Attribute currentAtt;
            foreach (XmlNode attributeNode in attributeList)
            {
                currentAtt = new Attribute();
                currentAtt.fromXml(attributeNode);
                itsGoverningAttributes.addOrSet(currentAtt);
            }

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

            XmlNodeList coefficientList = ((XmlElement)((XmlElement)node).
                GetElementsByTagName("Coefficients").Item(0)).GetElementsByTagName("Coefficient");
            Coefficient currentCoefficient;
            foreach (XmlNode Node in coefficientList)
            {
                currentCoefficient = new Coefficient();
                currentCoefficient.fromXml(Node);
                this.itsAtt_Coefficients.add(currentCoefficient);
            }
        }