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