2024-04-16 18:29:40 +00:00
|
|
|
namespace LootDumpProcessor.Process.Collector;
|
2023-08-12 19:08:38 +01:00
|
|
|
|
|
|
|
public static class CollectorFactory
|
|
|
|
{
|
2024-04-16 18:29:40 +00:00
|
|
|
private static ICollector? _collector;
|
2023-08-12 19:08:38 +01:00
|
|
|
public static ICollector GetInstance()
|
|
|
|
{
|
2024-04-16 18:29:40 +00:00
|
|
|
if (_collector == null)
|
|
|
|
_collector = LootDumpProcessorContext.GetConfig().CollectorConfig.CollectorType switch
|
|
|
|
{
|
|
|
|
CollectorType.Memory => new HashSetCollector(),
|
|
|
|
CollectorType.Dump => new DumpCollector(),
|
|
|
|
_ => throw new ArgumentOutOfRangeException()
|
|
|
|
};
|
|
|
|
return _collector;
|
2023-08-12 19:08:38 +01:00
|
|
|
}
|
|
|
|
}
|