Refactor serialization copying to use source generators (#19412)
This commit is contained in:
@@ -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; }
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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; }
|
||||
|
||||
@@ -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
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user