Innovenergy_trunk/csharp/Lib/StatusApi/CombinedStatus.cs

20 lines
530 B
C#
Raw Normal View History

2023-05-04 07:37:22 +00:00
using System.Collections;
2023-04-04 14:37:37 +00:00
namespace InnovEnergy.Lib.StatusApi;
#pragma warning disable CS8618
2023-05-04 07:37:22 +00:00
public class CombinedStatus<T> : IReadOnlyList<T>
2023-04-04 14:37:37 +00:00
{
2023-05-04 07:37:22 +00:00
public T? Combined { get; init; }
public IReadOnlyList<T> Stati { get; init; }
public Boolean Available => Stati.Count > 0;
public IEnumerator<T> GetEnumerator() => Stati.GetEnumerator();
IEnumerator IEnumerable.GetEnumerator() => GetEnumerator();
2023-04-04 14:37:37 +00:00
2023-05-04 07:37:22 +00:00
public Int32 Count => Stati.Count;
2023-04-04 14:37:37 +00:00
2023-05-04 07:37:22 +00:00
public T this[Int32 index] => Stati[index];
2023-04-04 14:37:37 +00:00
}