Пример #1
0
        public static HeroExpData GetPlayerExpDataByLv(int lv)
        {
            HeroExpData data = null;

            if (HeroExpDataDictionary.ContainsKey(lv) && HeroExpDataDictionary[lv] != null)
            {
                data = _heroExpDataDictionary[lv];
            }
            return(data);
        }
Пример #2
0
        public static HeroExpData GetHeroExpData(int oldExp, int addExp = 0)
        {
            int totalExp = oldExp + addExp;
            List <HeroExpData> dataList = GetHeroExpDataList();
            HeroExpData        data     = null;

            for (int i = 0, count = dataList.Count; i < count; i++)
            {
                data = dataList[i];
                if (totalExp < data.exp_total)
                {
                    return(data);
                }
            }
            return(null);
        }
Пример #3
0
        public static HeroExpData GetHeroExpDataByLv(int lv)
        {
            HeroExpData data = null;


            if (lv == 0)
            {
                data    = new HeroExpData();
                data.lv = data.exp = data.exp_total = 0;
            }
            else
            {
                if (HeroExpDataDictionary.ContainsKey(lv) && HeroExpDataDictionary[lv] != null)
                {
                    data = _heroExpDataDictionary[lv];
                }
            }
            return(data);
        }