using System; using System.Collections.Generic; using ProtoCSStruct; namespace Game { public class RankLimitInfo { public readonly bool sortByLess; public long limitScore; public RankLimitInfo(bool sortByLess) { this.sortByLess = sortByLess; limitScore = 0; } } public class KVPair : IComparable { public readonly int Key; public readonly long Value; public KVPair(int key, long value) { Key = key; Value = value; } public int CompareTo(Object obj) { KVPair other = obj as KVPair; return Value.CompareTo(other.Value); } } //Game缓存了一些排行榜相关的消息 public class GameRankInfo { //静态数据 public static Dictionary MainlandRankMap; //副本id对应的排行榜id public static Dictionary > > RaceScoreRankMap; //种族积分对应的排行榜id //成员数据 public Dictionary m_stopUpdateRank; //停止更新的排行榜 public Dictionary m_rankLimitInfo; //排行榜限制分数 public Dictionary m_canAwardRank; //能领奖的排行榜 public static void InitRankConfig() { MainlandRankMap = new Dictionary(); RaceScoreRankMap = new Dictionary>>(); RaceScoreRankMap.Add(RaceType.Ren, new List>()); RaceScoreRankMap.Add(RaceType.Shen, new List>()); RaceScoreRankMap.Add(RaceType.Yao, new List>()); //读配置 foreach (var item in RaceScoreRankMap) { item.Value.Sort((t1, t2) => { return t1.Value.CompareTo(t2.Value); }); } } public GameRankInfo() { m_stopUpdateRank = new Dictionary(); m_rankLimitInfo = new Dictionary(); m_canAwardRank = new Dictionary(); } } }