101 lines
2.3 KiB
C#
101 lines
2.3 KiB
C#
// 此文件由 ThriftIntegratedPipeline 自动生成,请勿手动修改
|
||
// 配置类: CardStickerExchangeCfg
|
||
// 数据类: CardStickerExchangeCfgItem
|
||
|
||
using UnityEngine;
|
||
using Byway.Config;
|
||
using Byway.Thrift.Data;
|
||
using UnityGameFramework.Runtime;
|
||
|
||
namespace CrazyMaple
|
||
{
|
||
/// <summary>
|
||
/// CardStickerExchangeCfg 数据行
|
||
/// </summary>
|
||
public class DRCardStickerExchangeCfg : DataRowBase
|
||
{
|
||
private CardStickerExchangeCfgItem _configData;
|
||
|
||
/// <summary>
|
||
/// 唯一标识
|
||
/// </summary>
|
||
public override int Id
|
||
{
|
||
get
|
||
{
|
||
return _configData?.Id ?? 0;
|
||
}
|
||
}
|
||
|
||
/// <summary>
|
||
/// Icon
|
||
/// </summary>
|
||
public string Icon
|
||
{
|
||
get
|
||
{
|
||
return _configData?.Icon ?? "";
|
||
}
|
||
}
|
||
|
||
/// <summary>
|
||
/// Cost
|
||
/// </summary>
|
||
public int Cost
|
||
{
|
||
get
|
||
{
|
||
return _configData?.Cost ?? 0;
|
||
}
|
||
}
|
||
|
||
/// <summary>
|
||
/// RewardId
|
||
/// </summary>
|
||
public string RewardId
|
||
{
|
||
get
|
||
{
|
||
return _configData?.RewardId ?? "";
|
||
}
|
||
}
|
||
|
||
/// <summary>
|
||
/// RewardCnt
|
||
/// </summary>
|
||
public string RewardCnt
|
||
{
|
||
get
|
||
{
|
||
return _configData?.RewardCnt ?? "";
|
||
}
|
||
}
|
||
|
||
/// <summary>
|
||
/// 从配置加载数据
|
||
/// </summary>
|
||
public void LoadFromConfig(int id)
|
||
{
|
||
var config = ConfigManager.Instance.GetConfig<CardStickerExchangeCfg>();
|
||
if (config?.Cardstickerexchangecfgs != null)
|
||
{
|
||
config.Cardstickerexchangecfgs.TryGetValue(id, out _configData);
|
||
}
|
||
}
|
||
|
||
/// <summary>
|
||
/// 解析数据行(兼容旧系统,实际使用 LoadFromConfig)
|
||
/// </summary>
|
||
public override bool ParseDataRow(string dataRowString, object userData)
|
||
{
|
||
int id = 0;
|
||
if (int.TryParse(dataRowString, out id))
|
||
{
|
||
LoadFromConfig(id);
|
||
return _configData != null;
|
||
}
|
||
return false;
|
||
}
|
||
}
|
||
}
|