2024-04-16 18:29:40 +00:00
|
|
|
using LootDumpProcessor.Model.Processing;
|
2023-08-12 19:08:38 +01:00
|
|
|
|
|
|
|
namespace LootDumpProcessor.Process.Collector;
|
|
|
|
|
|
|
|
public class HashSetCollector : ICollector
|
|
|
|
{
|
2024-04-16 18:29:40 +00:00
|
|
|
private readonly HashSet<PartialData> processedDumps = new(100_000);
|
|
|
|
private readonly object lockObject = new();
|
2023-08-12 19:08:38 +01:00
|
|
|
|
|
|
|
public void Setup()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
public void Hold(PartialData outputData)
|
|
|
|
{
|
|
|
|
lock (lockObject)
|
|
|
|
{
|
|
|
|
processedDumps.Add(outputData);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public List<PartialData> Retrieve()
|
|
|
|
{
|
|
|
|
return processedDumps.ToList();
|
|
|
|
}
|
|
|
|
}
|