//------------------------------------------------------------------------------
//
// This code was generated by a tool.
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
//
//------------------------------------------------------------------------------
using Luban;
using SimpleJSON;
namespace TableConfig
{
public sealed partial class TaskTable : Luban.BeanBase
{
public TaskTable(JSONNode _buf)
{
{ if(!_buf["Id"].IsNumber) { throw new SerializationException(); } Id = _buf["Id"]; }
{ if(!_buf["Type"].IsNumber) { throw new SerializationException(); } Type = (TaskType)_buf["Type"].AsInt; }
{ if(!_buf["Name"].IsString) { throw new SerializationException(); } Name = _buf["Name"]; }
{ if(!_buf["Description"].IsString) { throw new SerializationException(); } Description = _buf["Description"]; }
{ if(!_buf["PreTask"].IsNumber) { throw new SerializationException(); } PreTask = _buf["PreTask"]; }
{ var __json0 = _buf["ReceiveCondition"]; if(!__json0.IsArray) { throw new SerializationException(); } ReceiveCondition = new System.Collections.Generic.List(__json0.Count); foreach(JSONNode __e0 in __json0.Children) { int __v0; { if(!__e0.IsNumber) { throw new SerializationException(); } __v0 = __e0; } ReceiveCondition.Add(__v0); } }
{ var __json0 = _buf["SuccessCondition"]; if(!__json0.IsArray) { throw new SerializationException(); } SuccessCondition = new System.Collections.Generic.List(__json0.Count); foreach(JSONNode __e0 in __json0.Children) { int __v0; { if(!__e0.IsNumber) { throw new SerializationException(); } __v0 = __e0; } SuccessCondition.Add(__v0); } }
}
public static TaskTable DeserializeTaskTable(JSONNode _buf)
{
return new TaskTable(_buf);
}
///
/// 任务id
///
public readonly int Id;
///
/// 任务类型
///
public readonly TaskType Type;
///
/// 任务名称
///
public readonly string Name;
///
/// 任务描述
///
public readonly string Description;
///
/// 前置任务
///
public readonly int PreTask;
///
/// 接取条件
///
public readonly System.Collections.Generic.List ReceiveCondition;
///
/// 完成条件
///
public readonly System.Collections.Generic.List SuccessCondition;
public const int __ID__ = -2120818391;
public override int GetTypeId() => __ID__;
public void ResolveRef(Tables tables)
{
}
public override string ToString()
{
return "{ "
+ "Id:" + Id + ","
+ "Type:" + Type + ","
+ "Name:" + Name + ","
+ "Description:" + Description + ","
+ "PreTask:" + PreTask + ","
+ "ReceiveCondition:" + Luban.StringUtil.CollectionToString(ReceiveCondition) + ","
+ "SuccessCondition:" + Luban.StringUtil.CollectionToString(SuccessCondition) + ","
+ "}";
}
}
}