using System.Collections.Generic;
using UnityEngine;

public class AI_Inventory
{
    private List<GameObject> items = new List<GameObject>();

    public void AddItem(GameObject item)
    { 
        items.Add(item);
    }

    public GameObject FindItemWithTag(string tag)
    {
        foreach(GameObject item in items)
        {
            if(item.CompareTag(tag))
            {
                return item;
            }
        }
        return null;
    }

    public void RemoveItem(GameObject item)
    {
        int indexToRemove = items.IndexOf(item);
        if(indexToRemove >= 0)
        {
            items.RemoveAt(indexToRemove);
        }
    }

    // Additional helper methods
    public bool ContainsItem(GameObject item)
    {
        return items.Contains(item);
    }

    public void ClearInventory()
    {
        items.Clear();
    }

    public int ItemCount
    {
        get { return items.Count; }
    }
}