32 lines
853 B
C#
32 lines
853 B
C#
using System.Collections.Concurrent;
|
|
|
|
namespace YLErp.QdpModule
|
|
{
|
|
public class QdpMarketManager
|
|
{
|
|
private QdpMarketManager()
|
|
{
|
|
_prebuiltProxies = new ConcurrentDictionary<string, PrebuiltQdpMarketProxy>();
|
|
}
|
|
|
|
public PrebuiltQdpMarketProxy GetPrebuiltMarketProxy(string userId)
|
|
{
|
|
return _prebuiltProxies.GetOrAdd(userId, key => new PrebuiltQdpMarketProxy());
|
|
}
|
|
|
|
public bool RemovePrebuiltMarketProxy(string userId)
|
|
{
|
|
return _prebuiltProxies.TryRemove(userId, out _);
|
|
}
|
|
|
|
private readonly ConcurrentDictionary<string, PrebuiltQdpMarketProxy> _prebuiltProxies;
|
|
|
|
public static readonly QdpMarketManager Instance;
|
|
|
|
static QdpMarketManager()
|
|
{
|
|
Instance = new QdpMarketManager();
|
|
}
|
|
}
|
|
}
|