Beispiel #1
0
        private void RemoveFight(string name)
        {
            bool removed = ActiveFights.TryRemove(name, out Fight npc);

            removed = LifetimeFights.TryRemove(name, out byte bnpc) || removed;

            if (removed)
            {
                EventsRemovedFight?.Invoke(this, name);
            }
        }
Beispiel #2
0
        private void RemoveFight(string name)
        {
            if (!string.IsNullOrEmpty(name))
            {
                bool removed = ActiveFights.TryRemove(name, out Fight npc);
                removed = LifetimeFights.TryRemove(name, out byte bnpc) || removed;

                if (removed)
                {
                    EventsRemovedFight?.Invoke(this, name);
                }

                lock (OverlayFights)
                {
                    OverlayFights.Values.ToList().ForEach(fight =>
                    {
                        if (fight.Name.Equals(name, StringComparison.OrdinalIgnoreCase))
                        {
                            OverlayFights.TryRemove(fight.Id, out Fight _);
                        }
                    });
                }
            }
        }