Ejemplo n.º 1
0
 public bool addSkills(Skill newSkill)
 {
     if (itsSkills.Count < Globals.SKILL_LIMIT)
     {
         itsSkills.add(newSkill);
         return true;
     }
     return false;
 }
Ejemplo n.º 2
0
 public bool addModifiedSkill(Skill newModifiedSkill)
 {
     if (itsModifiedSkills.Count < Globals.ATTRIBUTE_LIMIT)
     {
         itsModifiedSkills.add(newModifiedSkill);
         return true;
     }
     return false;
 }
Ejemplo n.º 3
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);
        }
Ejemplo n.º 4
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);
     }
 }
Ejemplo n.º 5
0
 // This method only sets is_empty to true
 // on the skill.
 public bool removeSkills(Skill oldSkill)
 {
     Skill foundSkill=(Skill)itsSkills.find(oldSkill.Name);
     if (foundSkill!=null)
     {
         itsSkills.Remove(oldSkill);
         return true;
     }
     else
         return false;
 }
Ejemplo n.º 6
0
 public bool removeSkill(Skill oldSkill)
 {
     if (isSkill(oldSkill.Name))
     {
         itsSkills.Remove(oldSkill);
         return true;
     }
     else
         return false;
 }
Ejemplo n.º 7
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);
            }
        }
Ejemplo n.º 8
0
 public bool removeModifiedSkill(Skill oldModifiedSkill)
 {
     if (isModifiedSkill(oldModifiedSkill.Name))
     {
         itsModifiedSkills.Remove(oldModifiedSkill);
         return true;
     }
     else
         return false;
 }
Ejemplo n.º 9
0
        public Skill copy(Skill skill)
        {
            Skill copySkill =(Skill) base.copy(skill);
            //copySkill.Name = this.Name;
            //copySkill.Value = this.Value;

            for (int i = 0; i < itsWeaponModifiers.Length; i++)
                this.itsWeaponModifiers[i].copy(copySkill.itsWeaponModifiers[i]);

            copySkill.itsGoverningAttributes = this.itsGoverningAttributes.copy();

            for (int i = 0; i < itsGov_Weapons.Length; i++)
                this.itsGov_Weapons[i].copy(copySkill.itsGov_Weapons[i]);

            copySkill.itsGoverningStats  = this.itsGoverningStats .copy();

            copySkill.itsAtt_Coefficients = this.itsAtt_Coefficients.copy();

            return copySkill;
        }