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.Construction.Components
/// Used for construction graphs in building computers.
/// </summary>
[RegisterComponent]
public sealed class ComputerBoardComponent : Component
public sealed partial class ComputerBoardComponent : Component
{
[DataField("prototype", customTypeSerializer:typeof(PrototypeIdSerializer<EntityPrototype>))]
public string? Prototype { get; private set; }

View File

@@ -4,7 +4,7 @@ using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototy
namespace Content.Server.Construction.Components
{
[RegisterComponent, ComponentProtoName("Computer")]
public sealed class ComputerComponent : Component
public sealed partial class ComputerComponent : Component
{
[DataField("board", customTypeSerializer:typeof(PrototypeIdSerializer<EntityPrototype>))]
public string? BoardPrototype;

View File

@@ -5,7 +5,7 @@ using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototy
namespace Content.Server.Construction.Components
{
[RegisterComponent, Access(typeof(ConstructionSystem))]
public sealed class ConstructionComponent : Component
public sealed partial class ConstructionComponent : Component
{
[DataField("graph", required:true, customTypeSerializer:typeof(PrototypeIdSerializer<ConstructionGraphPrototype>))]
public string Graph { get; set; } = string.Empty;

View File

@@ -5,7 +5,7 @@ using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototy
namespace Content.Server.Construction.Components
{
[RegisterComponent, ComponentProtoName("Machine")]
public sealed class MachineComponent : Component
public sealed partial class MachineComponent : Component
{
[DataField("board", customTypeSerializer: typeof(PrototypeIdSerializer<EntityPrototype>))]
public string? BoardPrototype { get; private set; }

View File

@@ -6,7 +6,7 @@ using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototy
namespace Content.Server.Construction.Components
{
[RegisterComponent]
public sealed class MachineFrameComponent : Component
public sealed partial class MachineFrameComponent : Component
{
public const string PartContainerName = "machine_parts";
public const string BoardContainerName = "machine_board";
@@ -15,7 +15,7 @@ namespace Content.Server.Construction.Components
public bool HasBoard => BoardContainer?.ContainedEntities.Count != 0;
[DataField("progress", customTypeSerializer: typeof(PrototypeIdDictionarySerializer<int, MachinePartPrototype>))]
public readonly Dictionary<string, int> Progress = new();
public Dictionary<string, int> Progress = new();
[ViewVariables]
public readonly Dictionary<string, int> MaterialProgress = new();
@@ -46,7 +46,7 @@ namespace Content.Server.Construction.Components
}
[DataDefinition]
public sealed class MachineDeconstructedEvent : EntityEventArgs
public sealed partial class MachineDeconstructedEvent : EntityEventArgs
{
}
}

View File

@@ -3,7 +3,7 @@ using Robust.Shared.Audio;
namespace Content.Server.Construction.Components;
[RegisterComponent]
public sealed class PartExchangerComponent : Component
public sealed partial class PartExchangerComponent : Component
{
/// <summary>
/// How long it takes to exchange the parts

View File

@@ -8,7 +8,7 @@ namespace Content.Server.Construction.Components
/// For example, glass shard can be refined to glass sheet.
/// </summary>
[RegisterComponent]
public sealed class WelderRefinableComponent : Component
public sealed partial class WelderRefinableComponent : Component
{
[DataField("refineResult")]
public HashSet<string>? RefineResult = new();