using Fantasy.DataStructure.Collection;
using Fantasy.Entitas;
using MongoDB.Bson.Serialization.Attributes;
using MongoDB.Bson.Serialization.Options;
using NB.Game;

namespace NB;

public sealed class ItemContainer : Entity
{
    /// <summary>
    /// 最大格子数量
    /// </summary>
    public int CellCountMax;
    
    /// <summary>
    /// 容器内的物品  
    /// </summary>
    [BsonDictionaryOptions(DictionaryRepresentation.ArrayOfArrays)]
    public Dictionary<long, Item> Items = new Dictionary<long, Item>();
    
    /// <summary>
    /// 钓组信息
    /// </summary>
    [BsonDictionaryOptions(DictionaryRepresentation.ArrayOfArrays)]
    public Dictionary<long, List<long>> FishingRig = new Dictionary<long, List<long>>();
    
    // /// <summary>
    // /// 按物品id分组
    // /// </summary>
    // [BsonIgnore] public readonly OneToManyList<int, Item> ItemsByConfigId = new OneToManyListPool<int, Item>();
    //
    // /// <summary>
    // /// 容器内按物品类型分组
    // /// </summary>
    // [BsonIgnore] public readonly OneToManyList<uint, Item> ItemsByType = new OneToManyListPool<uint, Item>();
}