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.Shared.Chemistry.Components;
/// Think pouring this or draining from a water tank.
/// </summary>
[RegisterComponent, NetworkedComponent]
public sealed class DrainableSolutionComponent : Component
public sealed partial class DrainableSolutionComponent : Component
{
/// <summary>
/// Solution name that can be drained.

View File

@@ -11,7 +11,7 @@ namespace Content.Shared.Chemistry.Components
/// </summary>
[RegisterComponent]
[NetworkedComponent] // only needed for white-lists. Client doesn't actually need Solution data;
public sealed class FitsInDispenserComponent : Component
public sealed partial class FitsInDispenserComponent : Component
{
/// <summary>
/// Solution name that will interact with ReagentDispenserComponent.

View File

@@ -6,7 +6,7 @@ namespace Content.Shared.Chemistry.Components
//TODO: refactor movement modifier component because this is a pretty poor solution
[RegisterComponent]
[NetworkedComponent]
public sealed class MovespeedModifierMetabolismComponent : Component
public sealed partial class MovespeedModifierMetabolismComponent : Component
{
[ViewVariables]
public float WalkSpeedModifier { get; set; }

View File

@@ -9,7 +9,7 @@ namespace Content.Shared.Chemistry.Components;
/// tank of a car.
/// </summary>
[RegisterComponent, NetworkedComponent]
public sealed class RefillableSolutionComponent : Component
public sealed partial class RefillableSolutionComponent : Component
{
/// <summary>
/// Solution name that can added to easily.

View File

@@ -5,7 +5,7 @@ using Robust.Shared.Serialization;
namespace Content.Shared.Chemistry.Components;
[NetworkedComponent()]
public abstract class SharedHyposprayComponent : Component
public abstract partial class SharedHyposprayComponent : Component
{
[DataField("solutionName")]
public string SolutionName = "hypospray";

View File

@@ -6,7 +6,7 @@ using Robust.Shared.Serialization;
namespace Content.Shared.Chemistry.Components
{
[Serializable, NetSerializable]
public sealed class InjectorDoAfterEvent : SimpleDoAfterEvent
public sealed partial class InjectorDoAfterEvent : SimpleDoAfterEvent
{
}
@@ -14,7 +14,7 @@ namespace Content.Shared.Chemistry.Components
/// Shared class for injectors & syringes
/// </summary>
[NetworkedComponent, ComponentProtoName("Injector")]
public abstract class SharedInjectorComponent : Component
public abstract partial class SharedInjectorComponent : Component
{
/// <summary>
/// Component data used for net updates. Used by client for item status ui

View File

@@ -674,12 +674,12 @@ namespace Content.Shared.Chemistry.Components
[Serializable, NetSerializable]
[DataDefinition]
public readonly struct ReagentQuantity: IComparable<ReagentQuantity>
public readonly partial struct ReagentQuantity: IComparable<ReagentQuantity>
{
[DataField("ReagentId", customTypeSerializer:typeof(PrototypeIdSerializer<ReagentPrototype>), required:true)]
public readonly string ReagentId;
public string ReagentId { get; init; }
[DataField("Quantity", required:true)]
public readonly FixedPoint2 Quantity;
public FixedPoint2 Quantity { get; init; }
public ReagentQuantity(string reagentId, FixedPoint2 quantity)
{

View File

@@ -1,7 +1,7 @@
namespace Content.Shared.Chemistry.Components;
[RegisterComponent]
public sealed class SolutionScannerComponent : Component
public sealed partial class SolutionScannerComponent : Component
{
}

View File

@@ -7,7 +7,7 @@ namespace Content.Shared.Chemistry.Components;
/// Gives click behavior for transferring to/from other reagent containers.
/// </summary>
[RegisterComponent, NetworkedComponent]
public sealed class SolutionTransferComponent : Component
public sealed partial class SolutionTransferComponent : Component
{
/// <summary>
/// The amount of solution to be transferred from this solution when clicking on other solutions with it.