using System.Collections.Generic;
using UnityEngine;

namespace YachtDice.Modifiers.Definition
{
    [CreateAssetMenu(fileName = "ModifierCatalog", menuName = "YachtDice/Modifiers/Catalog")]
    public class ModifierCatalog : ScriptableObject
    {
        [SerializeField] private List<ModifierDefinition> modifiers = new();

        public IReadOnlyList<ModifierDefinition> All => modifiers;

        public ModifierDefinition FindById(string id)
        {
            for (int i = 0; i < modifiers.Count; i++)
            {
                if (modifiers[i] != null && modifiers[i].Id == id)
                    return modifiers[i];
            }
            return null;
        }
    }
}
