Refactor serialization copying to use source generators (#19412)
This commit is contained in:
@@ -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.
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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; }
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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";
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
namespace Content.Shared.Chemistry.Components;
|
||||
|
||||
[RegisterComponent]
|
||||
public sealed class SolutionScannerComponent : Component
|
||||
public sealed partial class SolutionScannerComponent : Component
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user