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

public class Inventory
{
    private int[] items;

    public delegate void InventorySetItem(int slot, int itemId);
    public event InventorySetItem OnSetItem;

    public int Size
    {
        get
        {
            return items.Length; 
        }
    }

    public Inventory(int numSlots)
    {
        items = new int[numSlots]; 
    }

    public void SetItem(int slot, int itemId)
    {
        items[slot] = itemId; 
        if(OnSetItem != null)
        {
            OnSetItem(slot, itemId); 
        }
    }

    public int GetItem(int slot)
    {
        return items[slot]; 
    }

    public int[] GetItems()
    {
        return items; 
    }

}
