using System.Collections.Generic; using UnityEngine; namespace YachtDice.Dice { [CreateAssetMenu(fileName = "DiceCatalog", menuName = "YachtDice/Dice/Catalog")] public class DiceCatalog : ScriptableObject { [SerializeField] private List dice = new(); public IReadOnlyList All => dice; public DiceDefinition FindById(string id) { foreach (var t in dice) { if (t != null && t.Id == id) return t; } return null; } #if UNITY_EDITOR public static DiceCatalog CreateForTest(List defs) { var catalog = CreateInstance(); catalog.dice = defs ?? new List(); return catalog; } #endif } }