using System.Collections; using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; // This could be optimized in a thousand different ways (better dynamic methods, source-gen this class), but eh. namespace PatMe2Mqtt.PatMeProxyApi { public readonly record struct EmoteCountersList(PatMe PatMe, object ProxiedValue) : IPatMeProxy, IEnumerable { public IEnumerator GetEnumerator() { foreach (var value in (IList) ProxiedValue) { yield return new EmoteCounter(PatMe, value); } } IEnumerator IEnumerable.GetEnumerator() => GetEnumerator(); } }