22 lines
686 B
C#
22 lines
686 B
C#
|
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<EmoteCounter>
|
|||
|
{
|
|||
|
public IEnumerator<EmoteCounter> GetEnumerator()
|
|||
|
{
|
|||
|
foreach (var value in (IList) ProxiedValue)
|
|||
|
{
|
|||
|
yield return new EmoteCounter(PatMe, value);
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
IEnumerator IEnumerable.GetEnumerator() => GetEnumerator();
|
|||
|
}
|
|||
|
}
|