//------------------------------------------------------------------------------
//
// 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;
namespace SepCore.Definition
{
public sealed partial class WeaponConfig : Luban.BeanBase
{
public WeaponConfig(ByteBuf _buf)
{
WeaponType = (WeaponType)_buf.ReadInt();
LogicType = _buf.ReadString();
Rarity = (Rarity)_buf.ReadInt();
Price = _buf.ReadInt();
Attack = _buf.ReadInt();
Cooldown = _buf.ReadInt();
AttackRange = _buf.ReadInt();
AttackSoundId = _buf.ReadInt();
{int n0 = System.Math.Min(_buf.ReadSize(), _buf.Size);Parameters = new System.Collections.Generic.Dictionary(n0 * 3 / 2);for(var i0 = 0 ; i0 < n0 ; i0++) { ParamType _k0; _k0 = (ParamType)_buf.ReadInt(); int _v0; _v0 = _buf.ReadInt(); Parameters.Add(_k0, _v0);}}
{int n0 = System.Math.Min(_buf.ReadSize(), _buf.Size);Modifiers = new System.Collections.Generic.List(n0);for(var i0 = 0 ; i0 < n0 ; i0++) { modifier _e0; _e0 = modifier.Deserializemodifier(_buf); Modifiers.Add(_e0);}}
Prefab = _buf.ReadString();
Prefab_Ref = null;
Sprite = _buf.ReadString();
Sprite_Ref = null;
}
public static WeaponConfig DeserializeWeaponConfig(ByteBuf _buf)
{
return new WeaponConfig(_buf);
}
///
/// 武器类型
///
public readonly WeaponType WeaponType;
///
/// 逻辑类型
///
public readonly string LogicType;
///
/// 道具品质
///
public readonly Rarity Rarity;
///
/// 武器价格
///
public readonly int Price;
///
/// 伤害
///
public readonly int Attack;
///
/// 冷却
///
public readonly int Cooldown;
///
/// 攻击范围
///
public readonly int AttackRange;
///
/// 攻击音效编号
///
public readonly int AttackSoundId;
///
/// 参数类型
///
public readonly System.Collections.Generic.Dictionary Parameters;
public readonly System.Collections.Generic.List Modifiers;
///
/// 预制体
///
public readonly string Prefab;
public EntityConfig Prefab_Ref;
///
/// 图标
///
public readonly string Sprite;
public SpriteConfig Sprite_Ref;
public const int __ID__ = 127041694;
public override int GetTypeId() => __ID__;
public void ResolveRef(Tables tables)
{
foreach (var _e in Modifiers) { _e?.ResolveRef(tables); }
Prefab_Ref = tables.TbEntityConfig.GetOrDefault(Prefab);
Sprite_Ref = tables.TbSpriteConfig.GetOrDefault(Sprite);
}
public override string ToString()
{
return "{ "
+ "weaponType:" + WeaponType + ","
+ "logicType:" + LogicType + ","
+ "rarity:" + Rarity + ","
+ "price:" + Price + ","
+ "attack:" + Attack + ","
+ "cooldown:" + Cooldown + ","
+ "attackRange:" + AttackRange + ","
+ "attackSoundId:" + AttackSoundId + ","
+ "parameters:" + Luban.StringUtil.CollectionToString(Parameters) + ","
+ "modifiers:" + Luban.StringUtil.CollectionToString(Modifiers) + ","
+ "prefab:" + Prefab + ","
+ "sprite:" + Sprite + ","
+ "}";
}
}
}