/// <summary>
        /// 通过[职业]二分快速查表
        /// </summary>
        /// <param name="job">职业</param>
        /// <returns></returns>
        public static IEnumerable <GridStrengthenSuitDataBase> Query(this List <GridStrengthenSuitDataBase> sorted, uint job)
        {
            var key = new GridStrengthenSuitDataBase()
            {
                job = job
            };
            var comparer = new Comparer1();
            var from     = sorted.BinarySearch(key, comparer);

            if (from < 0)
            {
                yield break;
            }
            var to = from + 1;

            while (from > 0 && comparer.Compare(key, sorted[from - 1]) == 0)
            {
                from--;
            }
            while (to < sorted.Count && comparer.Compare(key, sorted[to]) == 0)
            {
                to++;
            }
            for (var i = from; i < to; i++)
            {
                yield return(sorted[i]);
            }
        }
Beispiel #2
0
        /// <summary>
        /// 通过[主类ID]二分快速查表
        /// </summary>
        /// <param name="mainID">主类ID</param>
        /// <returns></returns>
        public static IEnumerable <RankTypeDataBase> Query(this List <RankTypeDataBase> sorted, uint mainID)
        {
            var key = new RankTypeDataBase()
            {
                mainID = mainID
            };
            var comparer = new Comparer1();
            var from     = sorted.BinarySearch(key, comparer);

            if (from < 0)
            {
                yield break;
            }
            var to = from + 1;

            while (from > 0 && comparer.Compare(key, sorted[from - 1]) == 0)
            {
                from--;
            }
            while (to < sorted.Count && comparer.Compare(key, sorted[to]) == 0)
            {
                to++;
            }
            for (var i = from; i < to; i++)
            {
                yield return(sorted[i]);
            }
        }
        /// <summary>
        /// 通过[大类ID]二分快速查表
        /// </summary>
        /// <param name="ID">大类ID</param>
        /// <returns></returns>
        public static IEnumerable <ConsignmentCateIDConf> Query(this List <ConsignmentCateIDConf> sorted, uint ID)
        {
            var key = new ConsignmentCateIDConf()
            {
                ID = ID
            };
            var comparer = new Comparer1();
            var from     = sorted.BinarySearch(key, comparer);

            if (from < 0)
            {
                yield break;
            }
            var to = from + 1;

            while (from > 0 && comparer.Compare(key, sorted[from - 1]) == 0)
            {
                from--;
            }
            while (to < sorted.Count && comparer.Compare(key, sorted[to]) == 0)
            {
                to++;
            }
            for (var i = from; i < to; i++)
            {
                yield return(sorted[i]);
            }
        }
Beispiel #4
0
        /// <summary>
        /// 通过[坐骑ID]二分快速查表
        /// </summary>
        /// <param name="rideId">坐骑ID</param>
        /// <returns></returns>
        public static IEnumerable <RideFeedData> Query(this List <RideFeedData> sorted, uint rideId)
        {
            var key = new RideFeedData()
            {
                rideId = rideId
            };
            var comparer = new Comparer1();
            var from     = sorted.BinarySearch(key, comparer);

            if (from < 0)
            {
                yield break;
            }
            var to = from + 1;

            while (from > 0 && comparer.Compare(key, sorted[from - 1]) == 0)
            {
                from--;
            }
            while (to < sorted.Count && comparer.Compare(key, sorted[to]) == 0)
            {
                to++;
            }
            for (var i = from; i < to; i++)
            {
                yield return(sorted[i]);
            }
        }
        /// <summary>
        /// 通过[背包ID]二分快速查表
        /// </summary>
        /// <param name="packId">背包ID</param>
        /// <returns></returns>
        public static IEnumerable <UnlockStoreDataBase> Query(this List <UnlockStoreDataBase> sorted, ushort packId)
        {
            var key = new UnlockStoreDataBase()
            {
                packId = packId
            };
            var comparer = new Comparer1();
            var from     = sorted.BinarySearch(key, comparer);

            if (from < 0)
            {
                yield break;
            }
            var to = from + 1;

            while (from > 0 && comparer.Compare(key, sorted[from - 1]) == 0)
            {
                from--;
            }
            while (to < sorted.Count && comparer.Compare(key, sorted[to]) == 0)
            {
                to++;
            }
            for (var i = from; i < to; i++)
            {
                yield return(sorted[i]);
            }
        }
Beispiel #6
0
        /// <summary>
        /// 通过[索引ID]二分快速查表
        /// </summary>
        /// <param name="wdID">索引ID</param>
        /// <returns></returns>
        public static IEnumerable <HomeLandViewDatabase> Query(this List <HomeLandViewDatabase> sorted, ushort wdID)
        {
            var key = new HomeLandViewDatabase()
            {
                wdID = wdID
            };
            var comparer = new Comparer1();
            var from     = sorted.BinarySearch(key, comparer);

            if (from < 0)
            {
                yield break;
            }
            var to = from + 1;

            while (from > 0 && comparer.Compare(key, sorted[from - 1]) == 0)
            {
                from--;
            }
            while (to < sorted.Count && comparer.Compare(key, sorted[to]) == 0)
            {
                to++;
            }
            for (var i = from; i < to; i++)
            {
                yield return(sorted[i]);
            }
        }