//------------------------------------------------------------------------------
// <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;


namespace GameConfig.TB
{
public sealed partial class TbGRoleEquipQuality : Luban.BeanBase
{
    public TbGRoleEquipQuality(ByteBuf _buf) 
    {
        Id = _buf.ReadInt();
        {int __n0 = System.Math.Min(_buf.ReadSize(), _buf.Size);Odds = new int[__n0];for(var __index0 = 0 ; __index0 < __n0 ; __index0++) { int __e0;__e0 = _buf.ReadInt(); Odds[__index0] = __e0;}}
        Total = _buf.ReadInt();
        {int __n0 = System.Math.Min(_buf.ReadSize(), _buf.Size);Materials = new TbGEntity.TResource[__n0];for(var __index0 = 0 ; __index0 < __n0 ; __index0++) { TbGEntity.TResource __e0;__e0 = TbGEntity.TResource.DeserializeTResource(_buf); Materials[__index0] = __e0;}}
        UpTime = _buf.ReadInt();
    }

    public static TbGRoleEquipQuality DeserializeTbGRoleEquipQuality(ByteBuf _buf)
    {
        return new TB.TbGRoleEquipQuality(_buf);
    }

    /// <summary>
    /// 锻造品质等级
    /// </summary>
    public readonly int Id;
    /// <summary>
    /// 品质出现的概率
    /// </summary>
    public readonly int[] Odds;
    /// <summary>
    /// 总概率
    /// </summary>
    public readonly int Total;
    /// <summary>
    /// 升级消耗的材料
    /// </summary>
    public readonly TbGEntity.TResource[] Materials;
    /// <summary>
    /// 升级所需时间(s)
    /// </summary>
    public readonly int UpTime;
   
    public const int __ID__ = -177949602;
    public override int GetTypeId() => __ID__;

    public  void ResolveRef(Tables tables)
    {
        
        
        
        foreach (var _e in Materials) { _e?.ResolveRef(tables); }
        
    }

    public override string ToString()
    {
        return "{ "
        + "id:" + Id + ","
        + "odds:" + Luban.StringUtil.CollectionToString(Odds) + ","
        + "total:" + Total + ","
        + "materials:" + Luban.StringUtil.CollectionToString(Materials) + ","
        + "upTime:" + UpTime + ","
        + "}";
    }
}

}