internal void AddVerifiedPet(string name) { if (!string.IsNullOrEmpty(name) && !VerifiedPets.ContainsKey(name)) { if (!VerifiedPlayers.ContainsKey(name) || string.IsNullOrEmpty(GetPlayerClass(name))) { VerifiedPlayers.TryRemove(name, out _); if (!IsPossiblePlayerName(name)) { if (name.StartsWith("A ", StringComparison.Ordinal) || name.StartsWith("An ", StringComparison.Ordinal)) { name = name.ToLower(CultureInfo.CurrentCulture); } if (!name.EndsWith("`s pet", StringComparison.OrdinalIgnoreCase) && !name.EndsWith("`s ward", StringComparison.OrdinalIgnoreCase) && !name.EndsWith("`s warder", StringComparison.OrdinalIgnoreCase) && !MainWindow.IsIgnoreCharmPetsEnabled) { CharmPets[name] = 1; } } else if (!PetToPlayer.ContainsKey(name)) { AddPetToPlayer(name, Labels.UNASSIGNED); } TakenPetOrPlayerAction.TryRemove(name, out _); if (VerifiedPets.TryAdd(name, 1)) { EventsNewVerifiedPet?.Invoke(this, name); } } } }
internal void AddVerifiedPet(string name) { TakenPetOrPlayerAction.TryRemove(name, out _); VerifiedPlayers.TryRemove(name, out _); if (VerifiedPets.TryAdd(name, 1)) { EventsNewVerifiedPet?.Invoke(this, name); } }