Пример #1
0
			public void ReuseProductContainer(ReuseableList<object> p)
			{
				if (p != productContainer)
				{
					containerPool.Destroy(p);
				}
			}
Пример #2
0
		public void ReuseSendIDs(ReuseableList<int> p)
		{
			if (p != sendedIDs)
			{
				listPool.Destroy(p);
			}
		}
Пример #3
0
			public ReuseableList<object> GetProductContainer()
			{
				if (0 >= productContainer.list.Count)
				{
					return null;
				}
				var ret = productContainer;
				productContainer = containerPool.Create();
				return ret;
			}
Пример #4
0
		public ReuseableList<int> GetSendIDs()
		{
			if (0 >= sendedIDs.list.Count)
			{
				return null;
			}
			var ret = sendedIDs;
			sendedIDs = listPool.Create();
			return ret;
		}
Пример #5
0
			public Context()
			{
				closed = false;
				containerPool = new ObjectPool<ReuseableList<object>>();
				productContainer = containerPool.Create();
			}
Пример #6
0
		protected virtual void Awake()
		{
			listPool = new ObjectPool<ReuseableList<int>>();
			sendedIDs = listPool.Create();
		}