using System; using XGame.Database; using XGame.Framework; namespace FL.Data.Items { public class EquipAttr : IDisposable { private Attributes _attributes; public Attributes Attributes => _attributes ??= ObjectPool.Acquire(); /// /// 装备唯一id /// public int Id { get; private set; } public EquipmentTable Table { get; private set; } /// /// 装备表格id /// public int TableId => Table.Id; public EItemType ItemType => EItemType.Equip; /// /// 装备部位 /// public EEquipType EquipType => Table.Part; public EQualityLevel Quality => Table.Quality; public string Name => Table.Name; public int Level { get; set; } /// /// 装备属性转化的战斗力 /// public long FightingPower { get; set; } public string Count { get; set; } public string Description { get; set; } public string Icon { get; set; } public void Init(EquipmentTable table, int id) { Table = table; Id = id; Icon = ItemTableRepo.Get(table.Id).Icon; } public void Dispose() { if (_attributes != null) { ObjectPool.Recycle(_attributes); } } } }