public void SetClasse(Classe def)
 {
     classeChar = def;
     OnClassChanged(this);
 }
        public Character(
            SerializableCharacter serializableCharacter,
            ITalentsManager manager,
            IRacesManager racesManager = null,
            IClassManager classManager = null
            )
            : this(serializableCharacter.Name, manager)
        {
            if (racesManager == null)
                racesManager = RacesManager.Instance;
            if (classManager == null)
                classManager = ClassManager.Instance;

            if (serializableCharacter.Talents != null)
            {
                foreach (var item in serializableCharacter.Talents)
                {
                    try
                    {
                        Talent talent = GetTalent(item.id);

                        if (item.bonus)
                        {
                            talent.Increment(item.level - 1);
                        }
                        else
                        {
                            talent.Increment(item.level);
                        }
                        talent.HaveBonus = item.bonus;
                        talent.SpeLevel = item.speLevel;
                    }
                    catch
                    {
                        continue;
                    }
                }
            }
            _aspectBonus = serializableCharacter.AspectBonus;
            _aspectMalus = serializableCharacter.AspectMalus;
            _race = racesManager.GetRace(serializableCharacter.Race);
            if (serializableCharacter.Classe != null && !serializableCharacter.Classe.Equals(""))
                classeChar = classManager.getFormName(serializableCharacter.Classe);
            else
                classeChar = null;
            ExperienceAvailable = serializableCharacter.Experience;
            Inventaire = serializableCharacter.Inventaire;
            if (_race != null)
                _bonusAspect = _race.AspectBonus;
            penPoid = serializableCharacter.penPoid;
            inventory = serializableCharacter.Inventory ?? new Inventory();
            RecomputePA();
        }
 private void CharacterManager_OnCharacterChanged(Character caller)
 {
     character = caller;
     character.GetTalent("Apprentissage").LevelChanged += (sender, args) => OnPropertyChanged(() => Competences);
     character.GetTalent("Maitrise").LevelChanged += (sender, args) => OnPropertyChanged(() => Competences);
     SelectedClasse = character.getClasse();
     OnPropertyChanged(null);
 }