/// <summary> /// 通过[等级]二分快速查表 /// </summary> /// <param name="Lv">等级</param> /// <returns></returns> public static GrowUpRecommendFightPowerDabaBase Query(this List <GrowUpRecommendFightPowerDabaBase> sorted, uint Lv) { var key = new GrowUpRecommendFightPowerDabaBase() { Lv = Lv }; var comparer = new Comparer1(); var index = sorted.BinarySearch(key, comparer); return(index >= 0 ? sorted[index] : default(GrowUpRecommendFightPowerDabaBase)); }
/// <summary> /// 推荐战力 /// </summary> /// <returns></returns> public uint GetRecommendFightPower() { IPlayer mainPlayer = Client.ClientGlobal.Instance().MainPlayer; if (mainPlayer == null) { Engine.Utility.Log.Error("出错啦!mainPlayer 没找到"); return(0); } int playerLv = mainPlayer.GetProp((int)CreatureProp.Level); GrowUpRecommendFightPowerDabaBase db = GameTableManager.Instance.GetTableItem <GrowUpRecommendFightPowerDabaBase>((uint)playerLv); if (db != null) { return(db.FightPower); } else { return(0); } }