[Refactor] Replace [SerializeField] + getter with [field: SerializeField] auto-properties

Convert serialized private fields with public arrow getters to
[field: SerializeField] auto-properties across ScriptableObjects
(DieDefinitionSO, CategoryDefinition, ModifierDefinition, Effect,
ModifierBehavior, SumOfValueCategory) and select MonoBehaviours
(DiceRoller, Dice.Entry struct). Fields with type-changing getters
(List→IReadOnlyList) or computed getters are intentionally kept as-is.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-01 21:28:48 +07:00
parent 30f9532fd7
commit f6c354d41c
8 changed files with 59 additions and 90 deletions
+4 -7
View File
@@ -9,15 +9,12 @@ namespace YachtDice.Dice
[Serializable]
public struct Entry : IEquatable<Entry>
{
[SerializeField] private int value;
[SerializeField] private Transform point;
[field: SerializeField] public int Value { get; private set; }
[field: SerializeField] public Transform Point { get; private set; }
public int Value => value;
public Transform Point => point;
public bool Equals(Entry other) => point == other.point;
public bool Equals(Entry other) => Point == other.Point;
public override bool Equals(object obj) => obj is Entry other && Equals(other);
public override int GetHashCode() => point != null ? point.GetHashCode() : 0;
public override int GetHashCode() => Point != null ? Point.GetHashCode() : 0;
}
[SerializeField] private List<Entry> entries = new();