示例#1
0
        public static void Initialize(PathData pathData)
        {
            cacheData = pathData;

            InitializeFilter();
            InitializeResourceList();
            if (resourceOrderDic == null)
            {
                resourceOrderDic = new Dictionary <string, Resource>();
            }
            else
            {
                resourceOrderDic.Clear();
            }

            if (resourceDicForCombine == null)
            {
                resourceDicForCombine = new Dictionary <string, Resource>();
            }
            else
            {
                resourceDicForCombine.Clear();
            }

            IndependentFilter = null;
            preFilter         = null;
        }
示例#2
0
        private static void InitializeSubResList()
        {
            if (subResourceList == null)
            {
                subResourceList = new List <Resource>();
            }
            else
            {
                subResourceList.Clear();
            }

            for (int i = 0; i < fullResourceList.Count; i++)
            {
                Resource res = fullResourceList[i];
                if (subFilter == null)
                {
                    subFilter = new ResourceFilter(cacheData.subResFilter);
                }

                if (subFilter.IsPassed(res.RelatePath))
                {
                    subResourceList.Add(res);
                }
            }
        }
示例#3
0
        private static void InitializeTrippleZipResList()
        {
            if (firstResourceList == null)
            {
                firstResourceList = new List <Resource>();
            }
            else
            {
                firstResourceList.Clear();
            }
            if (secondResourceList == null)
            {
                secondResourceList = new List <Resource>();
            }
            else
            {
                secondResourceList.Clear();
            }
            if (specialResourceList == null)
            {
                specialResourceList = new List <Resource>();
            }
            else
            {
                specialResourceList.Clear();
            }

            for (int i = 0; i < subResourceList.Count; i++)
            {
                Resource res = subResourceList[i];

                if (firstFilter == null)
                {
                    firstFilter = new ResourceFilter(cacheData.firstResFilter);
                }
                if (firstFilter.IsPassed(res.RelatePath))
                {
                    if (specialFilter == null)
                    {
                        specialFilter = new ResourceFilter(cacheData.specialResFilter);
                    }
                    if (specialFilter.IsPassed(res.RelatePath))
                    {
                        specialResourceList.Add(res);
                    }
                    else
                    {
                        firstResourceList.Add(res);
                    }
                }
                else
                {
                    secondResourceList.Add(res);
                }
            }
        }
示例#4
0
        public static ResourceOrderType GetResourceOrderType(string relatePath)
        {
            if (string.IsNullOrEmpty(relatePath))
            {
                return(ResourceOrderType.None);
            }

            if (preFilter == null)
            {
                preFilter = new ResourceFilter(cacheData.preDownloadFilter);
            }

            if (preFilter.IsPassed(relatePath))
            {
                return(ResourceOrderType.Important);
            }
            else
            {
                return(ResourceOrderType.Ordinary);
            }
        }
示例#5
0
        public static ResourceType GetResourceType(string relatePath)
        {
            if (string.IsNullOrEmpty(relatePath))
            {
                return(ResourceType.None);
            }

            if (IndependentFilter == null)
            {
                IndependentFilter = new ResourceFilter(cacheData.independentResFilter);
            }

            if (IndependentFilter.IsPassed(relatePath))
            {
                return(ResourceType.Independent);
            }
            else
            {
                return(ResourceType.Common);
            }
        }
示例#6
0
 private static void InitializeSpecialResourceFilter()
 {
     specialFilter = new ResourceFilter(cacheData.specialResFilter);
 }
示例#7
0
 private static void InitializeFirstResourceFilter()
 {
     firstFilter = new ResourceFilter(cacheData.firstResFilter);
 }
示例#8
0
 private static void InitializeSubResourceFilter()
 {
     subFilter = new ResourceFilter(cacheData.subResFilter);
 }