using System.Linq;
using Godot;
using Godot.Collections;

namespace Cirno.Scripts.Resources;

[GlobalClass]
public partial class ItemsDatabase : Resource
{
    [Export]
    public Array<LootItem> LootItems { get; set; } = new();

    public LootItem GetLootItem(string itemName)
    {
        return LootItems.FirstOrDefault(x => x.ItemKey == itemName);
    }
}