Refactor serialization copying to use source generators (#19412)

This commit is contained in:
DrSmugleaf
2023-08-22 18:14:33 -07:00
committed by GitHub
parent 08b43990ab
commit a88e747a0b
1737 changed files with 2532 additions and 2521 deletions

View File

@@ -7,7 +7,7 @@ namespace Content.Server.Magic.Components;
/// Spellbooks for having an entity learn spells as long as they've read the book and it's in their hand.
/// </summary>
[RegisterComponent]
public sealed class SpellbookComponent : Component
public sealed partial class SpellbookComponent : Component
{
/// <summary>
/// List of spells that this book has. This is a combination of the WorldSpells, EntitySpells, and InstantSpells.
@@ -20,15 +20,15 @@ public sealed class SpellbookComponent : Component
/// </summary>
[DataField("worldSpells", customTypeSerializer: typeof(PrototypeIdDictionarySerializer<int, WorldTargetActionPrototype>))]
[ViewVariables(VVAccess.ReadWrite)]
public readonly Dictionary<string, int> WorldSpells = new();
public Dictionary<string, int> WorldSpells = new();
[DataField("entitySpells", customTypeSerializer: typeof(PrototypeIdDictionarySerializer<int, EntityTargetActionPrototype>))]
[ViewVariables(VVAccess.ReadWrite)]
public readonly Dictionary<string, int> EntitySpells = new();
public Dictionary<string, int> EntitySpells = new();
[DataField("instantSpells", customTypeSerializer: typeof(PrototypeIdDictionarySerializer<int, InstantActionPrototype>))]
[ViewVariables(VVAccess.ReadWrite)]
public readonly Dictionary<string, int> InstantSpells = new();
public Dictionary<string, int> InstantSpells = new();
[DataField("learnTime")]
[ViewVariables(VVAccess.ReadWrite)]