Innovenergy_trunk/csharp/Lib/StatusApi/CombinedStatus.cs

20 lines
530 B
C#

using System.Collections;
namespace InnovEnergy.Lib.StatusApi;
#pragma warning disable CS8618
public class CombinedStatus<T> : IReadOnlyList<T>
{
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();
public Int32 Count => Stati.Count;
public T this[Int32 index] => Stati[index];
}