//------------------------------------------------------------------------------
//
// 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 cfg
{
public sealed partial class Item : Luban.BeanBase
{
public Item(JSONNode _buf)
{
{ if(!_buf["id"].IsNumber) { throw new SerializationException(); } Id = _buf["id"]; }
{ if(!_buf["model"].IsString) { throw new SerializationException(); } Model = _buf["model"]; }
{ if(!_buf["type"].IsNumber) { throw new SerializationException(); } Type = _buf["type"]; }
{ if(!_buf["quality"].IsNumber) { throw new SerializationException(); } Quality = _buf["quality"]; }
{ if(!_buf["brand"].IsNumber) { throw new SerializationException(); } Brand = _buf["brand"]; }
{ if(!_buf["weight"].IsNumber) { throw new SerializationException(); } Weight = _buf["weight"]; }
{ if(!_buf["length"].IsNumber) { throw new SerializationException(); } Length = _buf["length"]; }
{ if(!_buf["max"].IsNumber) { throw new SerializationException(); } Max = _buf["max"]; }
{ if(!_buf["auto_use"].IsNumber) { throw new SerializationException(); } AutoUse = _buf["auto_use"]; }
{ var __json0 = _buf["result1"]; if(!__json0.IsArray) { throw new SerializationException(); } Result1 = new System.Collections.Generic.List(__json0.Count); foreach(JSONNode __e0 in __json0.Children) { int __v0; { if(!__e0.IsNumber) { throw new SerializationException(); } __v0 = __e0; } Result1.Add(__v0); } }
{ var __json0 = _buf["result2"]; if(!__json0.IsArray) { throw new SerializationException(); } Result2 = new System.Collections.Generic.List(__json0.Count); foreach(JSONNode __e0 in __json0.Children) { string __v0; { if(!__e0.IsString) { throw new SerializationException(); } __v0 = __e0; } Result2.Add(__v0); } }
}
public static Item DeserializeItem(JSONNode _buf)
{
return new Item(_buf);
}
///
/// Id
///
public readonly int Id;
///
/// 模型
///
public readonly string Model;
///
/// 子类型
///
public readonly int Type;
///
/// 品质
///
public readonly int Quality;
///
/// 品牌
///
public readonly int Brand;
///
/// 重量(克)
///
public readonly int Weight;
///
/// 长度(毫米)
///
public readonly int Length;
///
/// 最大堆叠数量
///
public readonly int Max;
///
/// 获得自动使用
///
public readonly int AutoUse;
///
/// 使用参数1
///
public readonly System.Collections.Generic.List Result1;
///
/// 使用参数2
///
public readonly System.Collections.Generic.List Result2;
public const int __ID__ = 2289459;
public override int GetTypeId() => __ID__;
public void ResolveRef(Tables tables)
{
}
public override string ToString()
{
return "{ "
+ "id:" + Id + ","
+ "model:" + Model + ","
+ "type:" + Type + ","
+ "quality:" + Quality + ","
+ "brand:" + Brand + ","
+ "weight:" + Weight + ","
+ "length:" + Length + ","
+ "max:" + Max + ","
+ "autoUse:" + AutoUse + ","
+ "result1:" + Luban.StringUtil.CollectionToString(Result1) + ","
+ "result2:" + Luban.StringUtil.CollectionToString(Result2) + ","
+ "}";
}
}
}