
//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by a tool.
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

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<int>(__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<string>(__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);
    }

    /// <summary>
    /// Id
    /// </summary>
    public readonly int Id;
    /// <summary>
    /// 模型
    /// </summary>
    public readonly string Model;
    /// <summary>
    /// 子类型
    /// </summary>
    public readonly int Type;
    /// <summary>
    /// 品质
    /// </summary>
    public readonly int Quality;
    /// <summary>
    /// 品牌
    /// </summary>
    public readonly int Brand;
    /// <summary>
    /// 重量(克)
    /// </summary>
    public readonly int Weight;
    /// <summary>
    /// 长度（毫米）
    /// </summary>
    public readonly int Length;
    /// <summary>
    /// 最大堆叠数量
    /// </summary>
    public readonly int Max;
    /// <summary>
    /// 获得自动使用
    /// </summary>
    public readonly int AutoUse;
    /// <summary>
    /// 使用参数1
    /// </summary>
    public readonly System.Collections.Generic.List<int> Result1;
    /// <summary>
    /// 使用参数2
    /// </summary>
    public readonly System.Collections.Generic.List<string> 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) + ","
        + "}";
    }
}
}

