//------------------------------------------------------------------------------
// <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.TbGEntity
{
/// <summary>
/// 普通副本信息
/// </summary>
public sealed partial class TDungeon : Luban.BeanBase
{
    public TDungeon(ByteBuf _buf) 
    {
        Level = _buf.ReadInt();
        Boss = _buf.ReadInt();
        {int __n0 = System.Math.Min(_buf.ReadSize(), _buf.Size);Attributes = new TbGEntity.TAttributeValue[__n0];for(var __index0 = 0 ; __index0 < __n0 ; __index0++) { TbGEntity.TAttributeValue __e0;__e0 = TbGEntity.TAttributeValue.DeserializeTAttributeValue(_buf); Attributes[__index0] = __e0;}}
        {int __n0 = System.Math.Min(_buf.ReadSize(), _buf.Size);Rewards = new TbGEntity.TReward[__n0];for(var __index0 = 0 ; __index0 < __n0 ; __index0++) { TbGEntity.TReward __e0;__e0 = TbGEntity.TReward.DeserializeTReward(_buf); Rewards[__index0] = __e0;}}
    }

    public static TDungeon DeserializeTDungeon(ByteBuf _buf)
    {
        return new TbGEntity.TDungeon(_buf);
    }

    /// <summary>
    /// 副本关卡
    /// </summary>
    public readonly int Level;
    /// <summary>
    /// BOSS ID
    /// </summary>
    public readonly int Boss;
    /// <summary>
    /// BOSS 属性
    /// </summary>
    public readonly TbGEntity.TAttributeValue[] Attributes;
    /// <summary>
    /// 关卡奖励
    /// </summary>
    public readonly TbGEntity.TReward[] Rewards;
   
    public const int __ID__ = -191293256;
    public override int GetTypeId() => __ID__;

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

    public override string ToString()
    {
        return "{ "
        + "level:" + Level + ","
        + "boss:" + Boss + ","
        + "attributes:" + Luban.StringUtil.CollectionToString(Attributes) + ","
        + "rewards:" + Luban.StringUtil.CollectionToString(Rewards) + ","
        + "}";
    }
}

}