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;
|
}
|
}
|
}
|