13b18b0a8b
Standardize all class, interface, file, method, event, field, and variable names from the inconsistent "Die" form to "Dice", matching the existing DiceManager/DiceCatalog/DiceCollection convention. Renamed files (7 + meta): IDie→IDice, DieInstance→DiceInstance, DieDefinitionSO→DiceDefinitionSO, StandardDieSO→StandardDiceSO, DieValueCondition→DiceValueCondition, AddPerDieEffect→AddPerDiceEffect, MultiplyPerDieEffect→MultiplyPerDiceEffect. Updated all 31 consumer and test files with matching reference changes. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
33 lines
899 B
C#
33 lines
899 B
C#
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
namespace YachtDice.Dice
|
|
{
|
|
[CreateAssetMenu(fileName = "DiceCatalog", menuName = "YachtDice/Dice/Catalog")]
|
|
public class DiceCatalog : ScriptableObject
|
|
{
|
|
[SerializeField] private List<DiceDefinitionSO> dice = new();
|
|
|
|
public IReadOnlyList<DiceDefinitionSO> All => dice;
|
|
|
|
public DiceDefinitionSO FindById(string id)
|
|
{
|
|
for (int i = 0; i < dice.Count; i++)
|
|
{
|
|
if (dice[i] != null && dice[i].Id == id)
|
|
return dice[i];
|
|
}
|
|
return null;
|
|
}
|
|
|
|
#if UNITY_EDITOR
|
|
public static DiceCatalog CreateForTest(List<DiceDefinitionSO> defs)
|
|
{
|
|
var catalog = CreateInstance<DiceCatalog>();
|
|
catalog.dice = defs ?? new List<DiceDefinitionSO>();
|
|
return catalog;
|
|
}
|
|
#endif
|
|
}
|
|
}
|