common/LaaProduction/EquipmentsResult.cs
2026-04-23 17:50:07 +02:00

43 lines
952 B
C#

namespace LaaProduction
{
using System.Collections.Generic;
using System.Runtime.InteropServices;
[ClassInterface(ClassInterfaceType.AutoDual)]
public class EquipmentsResult
{
private readonly Queue<Equipment> equipments = new Queue<Equipment>();
public Error Error { get; set; }
public bool Succeeded => this.Error is null;
public int Count => this.equipments.Count;
public Equipment Next
{
get
{
var next = this.equipments.Dequeue();
this.equipments.Enqueue(next);
return next;
}
}
internal void AddRange(IEnumerable<Equipment> equipments)
{
if (equipments is null)
{
return;
}
foreach (var e in equipments)
{
this.equipments.Enqueue(e);
}
}
}
}