using System;
using System.Collections.Generic;
using KitsuneCafe.System;
using UnityEngine;

namespace KitsuneCafe.ItemSystem
{
    public class InventoryInstance : MonoBehaviour, IInventory<InventoryItem>
    {
        [SerializeField]
        private Inventory inventory;

        public int Capacity => inventory.Capacity;

        public int Count => inventory.Count;

        public IResult<Unit, InventoryError> Add(Item item, int count = 1)
        {
            return inventory.Add(item, count);
        }

        public IEnumerable<InventoryItem> Find(Func<InventoryItem, bool> predicate)
        {
            return inventory.Find(predicate);
        }

        public bool Has(Item item)
        {
            return inventory.Has(item);
        }

        public IResult<Unit, InventoryError> Remove(Item item, int count = 1)
        {
            return inventory.Remove(item, count);
        }
    }
}
