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

@@ -9,7 +9,7 @@ using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototy
namespace Content.Shared.VendingMachines
{
[RegisterComponent, NetworkedComponent]
public sealed class VendingMachineComponent : Component
public sealed partial class VendingMachineComponent : Component
{
/// <summary>
/// PrototypeID for the vending machine's inventory, see <see cref="VendingMachineInventoryPrototype"/>
@@ -246,7 +246,7 @@ namespace Content.Shared.VendingMachines
StatusKey,
}
public sealed class VendingMachineSelfDispenseEvent : InstantActionEvent
public sealed partial class VendingMachineSelfDispenseEvent : InstantActionEvent
{
};

View File

@@ -9,15 +9,15 @@ namespace Content.Shared.VendingMachines
{
[ViewVariables]
[IdDataField]
public string ID { get; } = default!;
public string ID { get; private set; } = default!;
[DataField("startingInventory", customTypeSerializer:typeof(PrototypeIdDictionarySerializer<uint, EntityPrototype>))]
public Dictionary<string, uint> StartingInventory { get; } = new();
public Dictionary<string, uint> StartingInventory { get; private set; } = new();
[DataField("emaggedInventory", customTypeSerializer:typeof(PrototypeIdDictionarySerializer<uint, EntityPrototype>))]
public Dictionary<string, uint>? EmaggedInventory { get; }
public Dictionary<string, uint>? EmaggedInventory { get; private set; }
[DataField("contrabandInventory", customTypeSerializer:typeof(PrototypeIdDictionarySerializer<uint, EntityPrototype>))]
public Dictionary<string, uint>? ContrabandInventory { get; }
public Dictionary<string, uint>? ContrabandInventory { get; private set; }
}
}

View File

@@ -7,7 +7,7 @@ using Robust.Shared.Serialization;
namespace Content.Shared.VendingMachines;
[RegisterComponent, NetworkedComponent, Access(typeof(SharedVendingMachineSystem))]
public sealed class VendingMachineRestockComponent : Component
public sealed partial class VendingMachineRestockComponent : Component
{
/// <summary>
/// The time (in seconds) that it takes to restock a machine.
@@ -47,6 +47,6 @@ public sealed class VendingMachineRestockComponent : Component
}
[Serializable, NetSerializable]
public sealed class RestockDoAfterEvent : SimpleDoAfterEvent
public sealed partial class RestockDoAfterEvent : SimpleDoAfterEvent
{
}