using ET;
using FairyGUI;
using Cal.DataTable;
using System.Collections.Generic;
namespace ET
{
public class BagHelper
{
///
/// 获取背包物品的名字和图标名 (名,图标资源名)
///
///
///
public static (string, string) GetIconName(int id)
{
if (id == 0) return (null,null);
if (id < 110000)
{
MaterialBase materialBase = DataTableHelper.Get(id);
return (materialBase.Name, materialBase.IconName);
}
if (id < 120000)
{
GoodsBase goodsBase = DataTableHelper.Get(id);
return (goodsBase.Name, goodsBase.IconName);
}
else
{
EquipBase equipBase = DataTableHelper.Get(id);
return (equipBase.Name, equipBase.IconName);
}
}
///
/// 根据Id获取物品类型(自行判断类型)
///
///
///
public static IConfig GetItemBase(int id)
{
if (id == 0) return null;
if (id < 110000)
{
return DataTableHelper.Get(id) as IConfig;
}
if (id < 120000)
{
return DataTableHelper.Get(id) as IConfig;
}
else
{
return DataTableHelper.Get(id) as IConfig;
}
}
}
}