示例#1
0
 /// <summary>
 /// 财富排行榜
 /// </summary>
 public static void RankCoin()
 {
     string noticeContent = string.Empty;
     CacheRank cacheRank = new CacheRank();
     var ranksArray = cacheRank.GetUserRankList();
     ranksArray.QuickSort((x, y) =>
     {
         if (x == null && y == null) return 0;
         if (x != null && y == null) return 1;
         if (x == null) return -1;
         return y.GameCoin.CompareTo(x.GameCoin);
     });
 }
示例#2
0
        /// <summary>
        /// 战力排行榜
        /// </summary>
        public static void RankCombatNum()
        {
            CacheRank cacheRank  = new CacheRank();
            var       ranksArray = cacheRank.GetUserRankList();

            ranksArray.QuickSort((x, y) =>
            {
                if (x == null && y == null)
                {
                    return(0);
                }
                if (x != null && y == null)
                {
                    return(1);
                }
                if (x == null)
                {
                    return(-1);
                }
                return(y.TotalCombatNum.CompareTo(x.TotalCombatNum));
            });
        }
示例#3
0
        /// <summary>
        /// 声望排行榜
        /// </summary>
        public static void RankObtion()
        {
            string    noticeContent = string.Empty;
            CacheRank cacheRank     = new CacheRank();
            var       ranksArray    = cacheRank.GetUserRankList();

            ranksArray.QuickSort((x, y) =>
            {
                if (x == null && y == null)
                {
                    return(0);
                }
                if (x != null && y == null)
                {
                    return(1);
                }
                if (x == null)
                {
                    return(-1);
                }
                return(y.ObtainNum.CompareTo(x.ObtainNum));
            });
        }
示例#4
0
        /// <summary>
        /// 等级排行榜
        /// </summary>
        public static void RankLv()
        {
            CacheRank cacheRank = new CacheRank();

            cacheRank.Load(int.MaxValue);
            List <UserRank> ranksArray = cacheRank.GetUserRankList();

            ranksArray.QuickSort((x, y) =>
            {
                int result;
                if (x == null && y == null)
                {
                    return(0);
                }
                if (x != null && y == null)
                {
                    return(1);
                }
                if (x == null)
                {
                    return(-1);
                }
                result = (int)y.UserLv.CompareTo(x.UserLv);
                if (result == 0)
                {
                    UserGeneral generalx = UserGeneral.GetMainGeneral(x.UserID);
                    UserGeneral generaly = UserGeneral.GetMainGeneral(y.UserID);
                    if (generalx != null && generaly != null)
                    {
                        result =
                            generaly.CurrExperience.CompareTo(
                                generalx.CurrExperience);
                    }
                }
                return(result);
            });
        }
示例#5
0
 /// <summary>
 /// 等级排行榜
 /// </summary>
 public static void RankLv()
 {
     CacheRank cacheRank = new CacheRank();
     cacheRank.Load(int.MaxValue);
     List<UserRank> ranksArray = cacheRank.GetUserRankList();
     ranksArray.QuickSort((x, y) =>
     {
         int result;
         if (x == null && y == null) return 0;
         if (x != null && y == null) return 1;
         if (x == null) return -1;
         result = (int)y.UserLv.CompareTo(x.UserLv);
         if (result == 0)
         {
             UserGeneral generalx = UserGeneral.GetMainGeneral(x.UserID);
             UserGeneral generaly = UserGeneral.GetMainGeneral(y.UserID);
             if (generalx != null && generaly != null)
             {
                 result =
                     generaly.CurrExperience.CompareTo(
                         generalx.CurrExperience);
             }
         }
         return result;
     });
 }
示例#6
0
 /// <summary>
 /// 战力排行榜
 /// </summary>
 public static void RankCombatNum()
 {
     CacheRank cacheRank = new CacheRank();
     var ranksArray = cacheRank.GetUserRankList();
     ranksArray.QuickSort((x, y) =>
     {
         if (x == null && y == null) return 0;
         if (x != null && y == null) return 1;
         if (x == null) return -1;
         return y.TotalCombatNum.CompareTo(x.TotalCombatNum);
     });
 }