52 lines
1.5 KiB
C#
52 lines
1.5 KiB
C#
using UnityGameFramework.Runtime;
|
|
|
|
namespace GeometryTD.DataTable
|
|
{
|
|
/// <summary>
|
|
/// 事件配置表
|
|
/// </summary>
|
|
public class DREvent : DataRowBase
|
|
{
|
|
private int m_Id = 0;
|
|
|
|
/// <summary>
|
|
/// 获取事件编号
|
|
/// </summary>
|
|
public override int Id => m_Id;
|
|
|
|
/// <summary>
|
|
/// 获取事件题目
|
|
/// </summary>
|
|
public string Title { get; private set; }
|
|
|
|
/// <summary>
|
|
/// 获取事件描述
|
|
/// </summary>
|
|
public string Description { get; private set; }
|
|
|
|
/// <summary>
|
|
/// 获取事件选项
|
|
/// </summary>
|
|
/// <remarks>原始字符串(如 JSON 文本),不在此处做解析。</remarks>
|
|
public string OptionsRaw { get; private set; }
|
|
|
|
public override bool ParseDataRow(string dataRowString, object userData)
|
|
{
|
|
string[] columnStrings = dataRowString.Split(DataTableExtension.DataSplitSeparators);
|
|
for (int i = 0; i < columnStrings.Length; i++)
|
|
{
|
|
columnStrings[i] = columnStrings[i].Trim(DataTableExtension.DataTrimSeparators);
|
|
}
|
|
|
|
int index = 0;
|
|
index++;
|
|
m_Id = int.Parse(columnStrings[index++]);
|
|
index++;
|
|
Title = columnStrings[index++];
|
|
Description = columnStrings[index++];
|
|
OptionsRaw = columnStrings[index++];
|
|
|
|
return true;
|
|
}
|
|
}
|
|
} |