private static IObjectPoolContainer I_GetObjectPoolContainer(ObjectPoolKey _key) { IObjectPoolContainer objectPoolContainer; if (!ObjectPoolManager.ms_ObjPools.TryGetValue(_key, out objectPoolContainer)) { bool flag = true; object[] customAttributes = _key.GetObjType().GetCustomAttributes(false); for (int i = 0; i < customAttributes.Length; i++) { ObjectPoolAttribute objectPoolAttribute = (ObjectPoolAttribute)customAttributes[i]; ObjectPoolAttribute objectPoolAttribute2 = objectPoolAttribute; if (objectPoolAttribute2 != null) { objectPoolContainer = objectPoolAttribute2.CreatePoolContainerStaticPrivate(objectPoolAttribute2); ObjectPoolManager.ms_ObjPools.Add(_key, objectPoolContainer); flag = false; break; } } if (flag) { TsLog.LogError("ObjectPoolManager.I_GetObjectPoolContainer(...). Fail creation {0}", new object[] { _key.GetObjType() }); } } return(objectPoolContainer); }
private static IObjectPoolContainer CreateInstanceStaicPrivate(ObjectPoolAttribute opa) { return(new StackObjectPool(opa)); }
private StackObjectPool(ObjectPoolAttribute opa) { this.m_opAttribute = opa; this.m_reuseStack = new Stack <object>(this.m_opAttribute.initCapacity); this.GrowPool_I(); }