public void controllInterfaceTalent(InterfaceTalent talent) { Assert.AreEqual(currentType, talent.GetType()); Assert.AreEqual(currentName, talent.getName()); Assert.AreEqual(currentComplexeName, talent.getName()); Assert.AreEqual(currentProbeCount, talent.getProbeCount()); Assert.AreEqual(currentProbeStringOne, talent.getProbeStringOne()); Assert.AreEqual(currentProbeStringTwo, talent.getProbeStringTwo()); Assert.AreEqual(currentBE, talent.getBe()); Assert.AreEqual(currentDeviate, talent.getDeviateString()); Assert.AreEqual(currentTAW, talent.getTaW()); Assert.AreEqual(currentTAWBonus, talent.getTAWBonus()); }
public void addTalent(InterfaceTalent talent) { if (talent == null) { return; } if (controll_TalentExist(talent)) { return; } if (getTalent(talent.getName()) != null) { return; } talent.setCharacter(this); List <InterfaceTalent> list = null; if (TalentDictionary.TryGetValue(talent.GetType(), out list)) { list.Add(talent); } else { list = new List <InterfaceTalent>(0); TalentDictionary.Add(talent.GetType(), list); this.addTalent(talent); } }
private void checkforDoppelTalents() { List <InterfaceTalent> talentlist = new List <InterfaceTalent>(0); foreach (List <InterfaceTalent> list in TalentDictonary.Values) { talentlist.AddRange(list); } for (int i = 0; i < talentlist.Count; i++) { InterfaceTalent checkTalent = talentlist[i]; for (int j = i + 1; j < talentlist.Count; j++) { InterfaceTalent currentTalent = talentlist[j]; if (String.Compare(checkTalent.getName(), currentTalent.getName()) == 0) { throw new FileLoadException("Doppeltes Talent Entdeckt: " + checkTalent.getName() + " mit dem Typ:" + checkTalent.GetType() + " " + currentTalent.GetType() + " BE:" + checkTalent.getBe()); } } } }
public InterfaceTalent getTalent(String name) { foreach (KeyValuePair <Type, List <InterfaceTalent> > pair in TalentDictionary) { List <InterfaceTalent> list = pair.Value; for (int i = 0; i < list.Count; i++) { InterfaceTalent talent = list[i]; if (String.Compare(talent.getName(), name) == 0) { return(talent); } } } return(null); }
private static XmlElement saveTalent(InterfaceTalent talent, XmlDocument characterFile, XmlElement element) { String name = talent.getName(); String taw = talent.getTaW().ToString(); name = nameRplacements(name); XmlElement TalentElement = characterFile.CreateElement(ManagmentXMLStrings.TalentElement); XmlElement NameElement = characterFile.CreateElement(ManagmentXMLStrings.Name); XmlElement TawElement = characterFile.CreateElement(ManagmentXMLStrings.TAW); TalentElement.AppendChild(NameElement).InnerText = name; TalentElement.AppendChild(TawElement).InnerText = taw; element.AppendChild(TalentElement); return(TalentElement); }
public void TalentTest_JustGeneratetTest_WithoutDiverateRequirement() { charakter = null; InterfaceTalent talent = getTalentWithoutDeviateRequirement(); List <TalentRequirement> trl = talent.getRequirementList(); List <TalentDeviate> tdl = talent.getDeviateList(); Assert.AreEqual(getTalentName(), talent.getName()); Assert.AreEqual(getProbeList().Count(), talent.getProbeCount()); Assert.AreEqual(getProbeStringOne(), talent.getProbeStringOne()); Assert.AreEqual(getProbeStringTwo(), talent.getProbeStringTwo()); Assert.AreEqual("-", talent.getTaW()); Assert.AreEqual("0", talent.getTAWBonus()); Assert.AreEqual(getBEString(), talent.getBe()); Assert.AreEqual(0, talent.getDeviateList().Count); Assert.AreEqual(0, talent.getRequirementList().Count); Assert.AreEqual("-", talent.getRequirementString()); Assert.AreEqual("-", talent.getDeviateString()); Assert.AreEqual("-", talent.getTaW()); Assert.AreEqual("0", talent.getTAWBonus()); }
private void loadRow(XmlNode rowElement) { String FontName = null; String LanguageName = null; FontTalent fTalent = null; LanguageTalent ltalent = null; foreach (XmlNode node in rowElement) { switch (node.Name) { case ManagmentXMLStrings.Language: LanguageName = node.InnerText; break; case ManagmentXMLStrings.Font: FontName = node.InnerText; break; } } if (0 != String.Compare("", FontName) && FontName != null) { InterfaceTalent talent = charakter.getTalent(FontName); if (talent == null) { Log.writeLogLine("Laden der Language Family " + FamilyName + ". Das Talent " + FontName + " exestiert nicht"); } else { if (typeof(FontTalent).IsAssignableFrom(talent.GetType())) { fTalent = (FontTalent)charakter.getTalent(FontName); } else { Log.writeLogLine("Laden der Language Family " + FamilyName + ". Das Talent " + talent.getName() + " ist kein FontTalent"); } } } if (0 != String.Compare("", LanguageName) && LanguageName != null) { InterfaceTalent talent = charakter.getTalent(LanguageName); if (talent == null) { Log.writeLogLine("Laden der Language Family " + FamilyName + ". Das Talent " + LanguageName + " exestiert nicht"); } else { if (typeof(LanguageTalent).IsAssignableFrom(talent.GetType())) { ltalent = (LanguageTalent)charakter.getTalent(LanguageName); } else { Log.writeLogLine("Laden der Language Family " + FamilyName + ". Das Talent " + talent.getName() + " ist kein LanguageTalent"); } } } if (fTalent == null) { fTalent = new FontTalent("", new List <string>()); } if (ltalent == null) { ltalent = new LanguageTalent("", new List <string>()); } LanguageFamily.addLanguageRow(ltalent, fTalent); }