LootDumpProcessor/Process/Collector/CollectorFactory.cs

17 lines
557 B
C#
Raw Normal View History

namespace LootDumpProcessor.Process.Collector;
2023-08-12 19:08:38 +01:00
public static class CollectorFactory
{
private static ICollector? _collector;
2023-08-12 19:08:38 +01:00
public static ICollector GetInstance()
{
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
}
}