refactor: fold hand-written serializable property setters into field hooks

Converts 113 [SerializableProperty] members whose setters only coerce the
value, reject it, or run post-change side effects into plain
[SerializableField] declarations using allowFieldChange and fieldChanged.
Wire- and schema-neutral: the migration schema regeneration produces zero
changes.

Kept as hand-written properties: custom getters (fallback defaults, lazy or
self-healing reads), virtual/override members, pre-assignment state capture
(durability unscale/scale sandwiches), and setters with exotic semantics
(work on equal assignment, early returns that skip persistence).

Behavioral notes: generated setters skip all work when the incoming value
equals the field, and always MarkDirty on change - a handful of converted
setters previously never marked dirty (their changes only persisted if
something else dirtied the entity) or re-ran side effects on equal
assignment.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Kamron Batman 2026-08-22 18:07:47 -07:00
parent 73f9688083
commit 4849c80750
No known key found for this signature in database
GPG key ID: 7D81DF26D9A5D94A
73 changed files with 893 additions and 1340 deletions

View file

@ -41,22 +41,14 @@ namespace Server.Items
}
}
[SerializableProperty(1)]
[CommandProperty(AccessLevel.GameMaster)]
public CraftResource Resource
{
get => _resource;
set
{
if (_resource != value)
{
_resource = value;
Hue = CraftResources.GetHue(_resource);
[SerializableField(1, fieldChanged: nameof(OnResourceChanged))]
[SerializedCommandProperty(AccessLevel.GameMaster)]
[InvalidateProperties]
private CraftResource _resource;
InvalidateProperties();
this.MarkDirty();
}
}
private void OnResourceChanged(CraftResource oldValue, CraftResource newValue)
{
Hue = CraftResources.GetHue(_resource);
}
public virtual bool RetainDeedHue => false;