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

@ -6,9 +6,6 @@ namespace Server.Items
[SerializationGenerator(1)]
public partial class LeafGloves : BaseArmor, IArcaneEquip
{
private int _maxArcaneCharges;
private int _curArcaneCharges;
[Constructible]
public LeafGloves() : base(0x2FC6) => Weight = 2.0;
@ -33,7 +30,7 @@ namespace Server.Items
public override ArmorMeditationAllowance DefMedAllowance => ArmorMeditationAllowance.All;
[EncodedInt]
[SerializableField(0)]
[SerializableProperty(0)]
[CommandProperty(AccessLevel.GameMaster)]
public int CurArcaneCharges
{
@ -47,7 +44,7 @@ namespace Server.Items
}
[EncodedInt]
[SerializableField(1)]
[SerializableProperty(1)]
[CommandProperty(AccessLevel.GameMaster)]
public int MaxArcaneCharges
{

View file

@ -6,9 +6,6 @@ namespace Server.Items
[SerializationGenerator(2, false)]
public partial class LeatherGloves : BaseArmor, IArcaneEquip
{
private int _maxArcaneCharges;
private int _curArcaneCharges;
[Constructible]
public LeatherGloves() : base(0x13C6) => Weight = 1.0;
@ -32,7 +29,7 @@ namespace Server.Items
public override ArmorMeditationAllowance DefMedAllowance => ArmorMeditationAllowance.All;
[EncodedInt]
[SerializableField(0)]
[SerializableProperty(0)]
[CommandProperty(AccessLevel.GameMaster)]
public int CurArcaneCharges
{
@ -46,7 +43,7 @@ namespace Server.Items
}
[EncodedInt]
[SerializableField(1)]
[SerializableProperty(1)]
[CommandProperty(AccessLevel.GameMaster)]
public int MaxArcaneCharges
{