private void NameChanged(AIProject.SaveData.Environment.ChickenInfo info) { if (info == null || info.AnimalData == null) { return; } AIProject.SaveData.AnimalData animalData = info.AnimalData; ReadOnlyDictionary <int, AnimalBase> source = !Singleton <AnimalManager> .IsInstance() ? (ReadOnlyDictionary <int, AnimalBase>)null : Singleton <AnimalManager> .Instance.AnimalTable; AnimalBase animalBase; if (source.IsNullOrEmpty <int, AnimalBase>() || !source.TryGetValue(animalData.AnimalID, ref animalBase) || !(animalBase is PetChicken)) { return; } (animalBase as PetChicken).Nickname = info.name; }