134 lines
2.9 KiB
C#
134 lines
2.9 KiB
C#
// 此文件由 ThriftIntegratedPipeline 自动生成,请勿手动修改
|
||
// 配置类: PassOne
|
||
// 数据类: PassOneItem
|
||
|
||
using UnityEngine;
|
||
using Byway.Config;
|
||
using Byway.Thrift.Data;
|
||
using UnityGameFramework.Runtime;
|
||
|
||
namespace CrazyMaple
|
||
{
|
||
/// <summary>
|
||
/// PassOne 数据行
|
||
/// </summary>
|
||
public class DRPassOne : DataRowBase
|
||
{
|
||
private PassOneItem _configData;
|
||
|
||
/// <summary>
|
||
/// 唯一标识
|
||
/// </summary>
|
||
public override int Id
|
||
{
|
||
get
|
||
{
|
||
return _configData?.Id ?? 0;
|
||
}
|
||
}
|
||
|
||
/// <summary>
|
||
/// Lv
|
||
/// </summary>
|
||
public int Lv
|
||
{
|
||
get
|
||
{
|
||
return _configData?.Lv ?? 0;
|
||
}
|
||
}
|
||
|
||
/// <summary>
|
||
/// FreeReward
|
||
/// </summary>
|
||
public string FreeReward
|
||
{
|
||
get
|
||
{
|
||
return _configData?.FreeReward ?? "";
|
||
}
|
||
}
|
||
|
||
/// <summary>
|
||
/// PayReward
|
||
/// </summary>
|
||
public string PayReward
|
||
{
|
||
get
|
||
{
|
||
return _configData?.PayReward ?? "";
|
||
}
|
||
}
|
||
|
||
/// <summary>
|
||
/// UpgradeGap
|
||
/// </summary>
|
||
public int UpgradeGap
|
||
{
|
||
get
|
||
{
|
||
return _configData?.UpgradeGap ?? 0;
|
||
}
|
||
}
|
||
|
||
/// <summary>
|
||
/// Price_Old
|
||
/// </summary>
|
||
public float Price_Old
|
||
{
|
||
get
|
||
{
|
||
return System.Convert.ToSingle(_configData?.Price_Old ?? 0.0);
|
||
}
|
||
}
|
||
|
||
/// <summary>
|
||
/// Price_New
|
||
/// </summary>
|
||
public float Price_New
|
||
{
|
||
get
|
||
{
|
||
return System.Convert.ToSingle(_configData?.Price_New ?? 0.0);
|
||
}
|
||
}
|
||
|
||
/// <summary>
|
||
/// Hour
|
||
/// </summary>
|
||
public int Hour
|
||
{
|
||
get
|
||
{
|
||
return _configData?.Hour ?? 0;
|
||
}
|
||
}
|
||
|
||
/// <summary>
|
||
/// 从配置加载数据
|
||
/// </summary>
|
||
public void LoadFromConfig(int id)
|
||
{
|
||
var config = ConfigManager.Instance.GetConfig<PassOne>();
|
||
if (config?.Passones != null)
|
||
{
|
||
config.Passones.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;
|
||
}
|
||
}
|
||
}
|