123 lines
2.7 KiB
C#
123 lines
2.7 KiB
C#
// 此文件由 ThriftIntegratedPipeline 自动生成,请勿手动修改
|
||
// 配置类: GrowthFund
|
||
// 数据类: GrowthFundItem
|
||
|
||
using UnityEngine;
|
||
using Byway.Config;
|
||
using Byway.Thrift.Data;
|
||
using UnityGameFramework.Runtime;
|
||
|
||
namespace CrazyMaple
|
||
{
|
||
/// <summary>
|
||
/// GrowthFund 数据行
|
||
/// </summary>
|
||
public class DRGrowthFund : DataRowBase
|
||
{
|
||
private GrowthFundItem _configData;
|
||
|
||
/// <summary>
|
||
/// 唯一标识
|
||
/// </summary>
|
||
public override int Id
|
||
{
|
||
get
|
||
{
|
||
return _configData?.Id ?? 0;
|
||
}
|
||
}
|
||
|
||
/// <summary>
|
||
/// Level
|
||
/// </summary>
|
||
public int Level
|
||
{
|
||
get
|
||
{
|
||
return _configData?.Level ?? 0;
|
||
}
|
||
}
|
||
|
||
/// <summary>
|
||
/// RewardIds
|
||
/// </summary>
|
||
public string RewardIds
|
||
{
|
||
get
|
||
{
|
||
return _configData?.RewardIds ?? "";
|
||
}
|
||
}
|
||
|
||
/// <summary>
|
||
/// RewardCnt
|
||
/// </summary>
|
||
public string RewardCnt
|
||
{
|
||
get
|
||
{
|
||
return _configData?.RewardCnt ?? "";
|
||
}
|
||
}
|
||
|
||
/// <summary>
|
||
/// Price
|
||
/// </summary>
|
||
public float Price
|
||
{
|
||
get
|
||
{
|
||
return System.Convert.ToSingle(_configData?.Price ?? 0.0);
|
||
}
|
||
}
|
||
|
||
/// <summary>
|
||
/// OriginPrice
|
||
/// </summary>
|
||
public float OriginPrice
|
||
{
|
||
get
|
||
{
|
||
return System.Convert.ToSingle(_configData?.OriginPrice ?? 0.0);
|
||
}
|
||
}
|
||
|
||
/// <summary>
|
||
/// Describe
|
||
/// </summary>
|
||
public string Describe
|
||
{
|
||
get
|
||
{
|
||
return _configData?.Describe ?? "";
|
||
}
|
||
}
|
||
|
||
/// <summary>
|
||
/// 从配置加载数据
|
||
/// </summary>
|
||
public void LoadFromConfig(int id)
|
||
{
|
||
var config = ConfigManager.Instance.GetConfig<GrowthFund>();
|
||
if (config?.Growthfunds != null)
|
||
{
|
||
config.Growthfunds.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;
|
||
}
|
||
}
|
||
}
|