/// <summary> /// Die TalentListe wird für die Ableitungen benötigt /// Ansonsten kann sie auch mit allen Talenten umgehen die anderweitig gesetzt werden /// </summary> /// <param name="charakter"></param> /// <param name="talentList"></param> public CharakterTalente(ICharakter charakter) { this.charakter = charakter; foreach (FightingValue value in (FightingValue[])Enum.GetValues(typeof(FightingValue))) { FightingValueDictionary.Add(value, new Dictionary <AbstractTalentFighting, int>()); } }
public int GetFightingValue(FightingValue fightingValue, AbstractTalentFighting talent) { if (talent == null) { return(0); } Dictionary <AbstractTalentFighting, int> fightingDictionary; FightingValueDictionary.TryGetValue(fightingValue, out fightingDictionary); if (fightingDictionary.TryGetValue(talent, out int innerValue)) { return(innerValue); } return(0); }
public void SetFightingValue(FightingValue fightingValue, AbstractTalentFighting talent, int value) { if (talent == null) { return; } Dictionary <AbstractTalentFighting, int> fightingDictionary; FightingValueDictionary.TryGetValue(fightingValue, out fightingDictionary); if (fightingDictionary.TryGetValue(talent, out int innerValue)) { fightingDictionary.Remove(talent); } fightingDictionary.Add(talent, value); }