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

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-01 16:33:15 +07:00
parent 85d639aa70
commit 62864dc103
7 changed files with 52 additions and 82 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();