示例#1
0
文件: Skill.cs 项目: jjaspe/Libraries
        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);
            }
        }