public Skill AddSkill(SkillType st) { // Get existing skill of this type Skill sk = Skills.GetByType(st); // If none, create new if (sk == null) { sk = new Skill(st); Skills.Add(sk); } // Show in report Faction.ShowSkill(st, false); // If maximum level was set as default, add derived skills if (sk.Level >= 100) { foreach (SkillType der in SkillType.List) { if (der.BasedOn != sk.Type || Skills.GetByType(der) != null || der.Special) { continue; } this.AddSkill(der); } } return(sk); }
private static void LoadSkills(SkillList skills, XmlNodeList nodeList) { foreach (XmlElement elSkill in nodeList) { SkillType t = SkillType.Get(elSkill.GetAttribute("type")); Skill s = new Skill(t); s.Level = Convert.ToInt32(elSkill.GetAttribute("level")); skills.Add(s); } }