feat: Updates to Serialization Generator v2.2 (#1157)

* Adds `SerializationProperty` - This will generate the private variable for serialization. Also provides an option `useField` to specify your own. Example:
  ```cs
  [SerializationProperty(0, useField: nameof(_resource)]
  ```
This commit is contained in:
Kamron Batman 2022-09-04 08:45:27 -07:00 committed by GitHub
parent d82028a071
commit 89815ad4d3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
50 changed files with 242 additions and 361 deletions

View file

@ -20,12 +20,6 @@ namespace Server;
[SerializationGenerator(0)]
public partial class ResistanceMod : MobileMod
{
// Field 0
private int _offset;
// Field 1
private ResistanceType _type;
public ResistanceMod(Mobile owner) : base(owner)
{
}
@ -36,7 +30,7 @@ public partial class ResistanceMod : MobileMod
_offset = offset;
}
[SerializableField(0)]
[SerializableProperty(0)]
public ResistanceType Type
{
get => _type;
@ -52,7 +46,7 @@ public partial class ResistanceMod : MobileMod
}
}
[SerializableField(1)]
[SerializableProperty(1)]
public int Offset
{
get => _offset;