
//------------------------------------------------------------------------------
// <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"]; }
    }

    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;
   
    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 + ","
        + "}";
    }
}
}

