chenxin
2020-12-11 080100a11100ac8ee44f0742d0a55b12d5db8485
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
using System.Collections.Generic;
 
/**
 * 精灵场内升级表处理类
 * @Author: chenxin
 * @Date: 2020-12-01 16:13:45
 */
namespace KTGMGemClient
{
    public class ElfUpgradeData
    {
        private static List<elf_upgrade> elfUpgradeList;
 
        /// <summary>
        /// 精灵塔等级上限
        /// </summary>
        public static int MaxTowerLevel { get; private set; } = 5;
 
        public static void Init()
        {
            elfUpgradeList = JsonDataCenter.GetList<elf_upgrade>();
 
            if (elfUpgradeList.Count - 1 >= 0)
                MaxTowerLevel = elfUpgradeList[elfUpgradeList.Count - 1].id;
        }
 
        /// <summary>
        /// 根据id获取表数据
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public static elf_upgrade GetDataById(int id)
        {
            for (int i = 0; i < elfUpgradeList.Count; ++i)
            {
                if (elfUpgradeList[i].id == id)
                    return elfUpgradeList[i];
            }
 
            return null;
        }
    }
}