Exemplo n.º 1
0
        public Stat copy(Stat copyStat)
        {
            copyStat=(Stat)base.copy(copyStat);
            if (copyStat == null)
                copyStat = new Stat();

            return copyStat;
        }
Exemplo n.º 2
0
 public bool removeStat(Stat oldStat)
 {
     if (isStat(oldStat.Name))
     {
         itsStats.Remove(oldStat);
         return true;
     }
     else
         return false;
 }
Exemplo 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);
            }
        }
Exemplo n.º 4
0
 public bool addStat(Stat newStat)
 {
     if (itsStats.Count < Globals.STAT_LIMIT)
     {
         itsStats.add(newStat);
         return true;
     }
     return false;
 }
Exemplo n.º 5
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);
            }
        }