28 lines
597 B
C#
28 lines
597 B
C#
|
// File: Services/Scanners/ScanQueue.cs
|
|||
|
|
|||
|
namespace WebmrAPI.Services.Scanners
|
|||
|
{
|
|||
|
public class ScanQueue : IScannable
|
|||
|
{
|
|||
|
private ScanTarget _target = 0;
|
|||
|
public ScanTarget Target { get => _target; }
|
|||
|
|
|||
|
private Queue<IScannable> _queue = new();
|
|||
|
|
|||
|
public ScanQueue Add(IScannable item)
|
|||
|
{
|
|||
|
_queue.Enqueue(item);
|
|||
|
_target |= item.Target;
|
|||
|
return this;
|
|||
|
}
|
|||
|
|
|||
|
public void Scan()
|
|||
|
{
|
|||
|
while (_queue.Count > 0)
|
|||
|
{
|
|||
|
_queue.Dequeue().Scan();
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
}
|