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

[CreateAssetMenu(fileName = "Inventory", menuName = "Inventory Database")]
public class InventoryDatabase : ScriptableObject
{
	[System.Serializable]
	public class ItemList : Malee.ReorderableArray<Item> { }

	[Malee.Reorderable("name")]
	public ItemList items;

	public Item Find(string id) {
		foreach (Item item in items)
			if (item.name == id)
				return item;

		Debug.LogError($"Missing inventory item '{id}'.");
		return null;
	}
}
