public void Release(ListUpgrade type, AgentRemote agent) { if (AgentPools.TryGetValue(type.GetHashCode(), out Pooling <AgentRemote> pool)) { pool.Release(agent); } else { CreatePool(type).Release(agent); } }
public AgentRemote GetItem(ListUpgrade type) { if (AgentPools.TryGetValue(type.GetHashCode(), out Pooling <AgentRemote> pool)) { return(pool.GetItem()); } else { return(CreatePool(type).GetItem()); } }