[Refactor] Replace [SerializeField] + getter with [field: SerializeField] auto-properties
This commit is contained in:
@@ -6,11 +6,11 @@ namespace YachtDice.Dice
|
||||
[CreateAssetMenu(fileName = "DiceCatalog", menuName = "YachtDice/Dice/Catalog")]
|
||||
public class DiceCatalog : ScriptableObject
|
||||
{
|
||||
[SerializeField] private List<DieDefinitionSO> dice = new();
|
||||
[SerializeField] private List<DiсeDefinition> dice = new();
|
||||
|
||||
public IReadOnlyList<DieDefinitionSO> All => dice;
|
||||
public IReadOnlyList<DiсeDefinition> All => dice;
|
||||
|
||||
public DieDefinitionSO FindById(string id)
|
||||
public DiсeDefinition FindById(string id)
|
||||
{
|
||||
for (int i = 0; i < dice.Count; i++)
|
||||
{
|
||||
@@ -21,10 +21,10 @@ namespace YachtDice.Dice
|
||||
}
|
||||
|
||||
#if UNITY_EDITOR
|
||||
public static DiceCatalog CreateForTest(List<DieDefinitionSO> defs)
|
||||
public static DiceCatalog CreateForTest(List<DiсeDefinition> defs)
|
||||
{
|
||||
var catalog = CreateInstance<DiceCatalog>();
|
||||
catalog.dice = defs ?? new List<DieDefinitionSO>();
|
||||
catalog.dice = defs ?? new List<DiсeDefinition>();
|
||||
return catalog;
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user