[Refactor] Replace [SerializeField] + getter with [field: SerializeField] auto-properties
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user