using System.Collections.Generic; using System.Linq; namespace TyphoonEvent { public class ProxyCollection { public HashSet Proxies { get; } = new HashSet(); public bool Changed { get; set; } = true; public void Add(IEventProxy proxy) { Changed |= Proxies.Add(proxy); } public void Remove(IEventProxy proxy) { Changed |= Proxies.Remove(proxy); } public IEventProxy[] RebuildHandlerArray() { Changed = false; return Proxies.ToArray(); } } }