Exemplo n.º 1
0
        private ObjectPool <BaseData> createDataPool(int type)
        {
            ObjectPool <BaseData> pool = new ObjectPool <BaseData>(() => BytesControl.getDataByID(type));

            pool.setNeedClear(false);

            return(pool);
        }
Exemplo n.º 2
0
        public BaseData createData(int type)
        {
            ObjectPool <BaseData> pool = _dataDic.get(type);

            if (pool == null)
            {
                return(BytesControl.getDataByID(type));
            }

            return(pool.getOne());
        }