Refactor serialization copying to use source generators (#19412)
This commit is contained in:
@@ -7,21 +7,21 @@ using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototy
|
||||
namespace Content.Shared.Construction.Components
|
||||
{
|
||||
[RegisterComponent, NetworkedComponent]
|
||||
public sealed class MachineBoardComponent : Component
|
||||
public sealed partial class MachineBoardComponent : Component
|
||||
{
|
||||
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
|
||||
|
||||
[DataField("requirements", customTypeSerializer: typeof(PrototypeIdDictionarySerializer<int, MachinePartPrototype>))]
|
||||
public readonly Dictionary<string, int> Requirements = new();
|
||||
public Dictionary<string, int> Requirements = new();
|
||||
|
||||
[DataField("materialRequirements")]
|
||||
public readonly Dictionary<string, int> MaterialIdRequirements = new();
|
||||
public Dictionary<string, int> MaterialIdRequirements = new();
|
||||
|
||||
[DataField("tagRequirements")]
|
||||
public readonly Dictionary<string, GenericPartInfo> TagRequirements = new();
|
||||
public Dictionary<string, GenericPartInfo> TagRequirements = new();
|
||||
|
||||
[DataField("componentRequirements")]
|
||||
public readonly Dictionary<string, GenericPartInfo> ComponentRequirements = new();
|
||||
public Dictionary<string, GenericPartInfo> ComponentRequirements = new();
|
||||
|
||||
[ViewVariables(VVAccess.ReadWrite)]
|
||||
[DataField("prototype")]
|
||||
@@ -42,7 +42,7 @@ namespace Content.Shared.Construction.Components
|
||||
|
||||
[Serializable]
|
||||
[DataDefinition]
|
||||
public struct GenericPartInfo
|
||||
public partial struct GenericPartInfo
|
||||
{
|
||||
[DataField("Amount")]
|
||||
public int Amount;
|
||||
|
||||
Reference in New Issue
Block a user