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

@@ -4,7 +4,7 @@ using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototy
namespace Content.Server.Tools.Components;
[RegisterComponent]
public sealed class LatticeCuttingComponent : Component
public sealed partial class LatticeCuttingComponent : Component
{
[DataField("qualityNeeded", customTypeSerializer:typeof(PrototypeIdSerializer<ToolQualityPrototype>))]
public string QualityNeeded = "Cutting";

View File

@@ -5,7 +5,7 @@ namespace Content.Server.Tools.Components;
[RegisterComponent]
[Access(typeof(WeldableSystem))]
public sealed class LayerChangeOnWeldComponent : Component
public sealed partial class LayerChangeOnWeldComponent : Component
{
[DataField("unWeldedLayer")]
[ViewVariables]

View File

@@ -5,14 +5,14 @@ using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototy
namespace Content.Server.Tools.Components
{
[RegisterComponent]
public sealed class TilePryingComponent : Component
public sealed partial class TilePryingComponent : Component
{
[DataField("toolComponentNeeded")]
public bool ToolComponentNeeded = true;
[DataField("qualityNeeded", customTypeSerializer:typeof(PrototypeIdSerializer<ToolQualityPrototype>))]
public string QualityNeeded = "Prying";
/// <summary>
/// Whether this tool can pry tiles with CanAxe.
/// </summary>

View File

@@ -10,7 +10,7 @@ namespace Content.Server.Tools.Components;
/// </summary>
[RegisterComponent]
[Access(typeof(WeldableSystem))]
public sealed class WeldableComponent : SharedWeldableComponent
public sealed partial class WeldableComponent : SharedWeldableComponent
{
/// <summary>
/// Tool quality for welding.

View File

@@ -8,46 +8,46 @@ using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototy
namespace Content.Server.Tools.Components
{
[RegisterComponent]
public sealed class WelderComponent : SharedWelderComponent
public sealed partial class WelderComponent : SharedWelderComponent
{
/// <summary>
/// Solution on the entity that contains the fuel.
/// </summary>
[DataField("fuelSolution"), ViewVariables(VVAccess.ReadWrite)]
public string FuelSolution { get; } = "Welder";
public string FuelSolution { get; private set; } = "Welder";
/// <summary>
/// Reagent that will be used as fuel for welding.
/// </summary>
[DataField("fuelReagent", customTypeSerializer:typeof(PrototypeIdSerializer<ReagentPrototype>)), ViewVariables(VVAccess.ReadWrite)]
public string FuelReagent { get; } = "WeldingFuel";
public string FuelReagent { get; private set; } = "WeldingFuel";
/// <summary>
/// Fuel consumption per second, while the welder is active.
/// </summary>
[DataField("fuelConsumption"), ViewVariables(VVAccess.ReadWrite)]
public FixedPoint2 FuelConsumption { get; } = FixedPoint2.New(2.0f);
public FixedPoint2 FuelConsumption { get; private set; } = FixedPoint2.New(2.0f);
/// <summary>
/// A fuel amount to be consumed when the welder goes from being unlit to being lit.
/// </summary>
[DataField("fuelLitCost"), ViewVariables(VVAccess.ReadWrite)]
public FixedPoint2 FuelLitCost { get; } = FixedPoint2.New(0.5f);
public FixedPoint2 FuelLitCost { get; private set; } = FixedPoint2.New(0.5f);
/// <summary>
/// Sound played when the welder is turned off.
/// </summary>
[DataField("welderOffSounds")]
public SoundSpecifier WelderOffSounds { get; } = new SoundCollectionSpecifier("WelderOff");
public SoundSpecifier WelderOffSounds { get; private set; } = new SoundCollectionSpecifier("WelderOff");
/// <summary>
/// Sound played when the tool is turned on.
/// </summary>
[DataField("welderOnSounds")]
public SoundSpecifier WelderOnSounds { get; } = new SoundCollectionSpecifier("WelderOn");
public SoundSpecifier WelderOnSounds { get; private set; } = new SoundCollectionSpecifier("WelderOn");
[DataField("welderRefill")]
public SoundSpecifier WelderRefill { get; } = new SoundPathSpecifier("/Audio/Effects/refill.ogg");
public SoundSpecifier WelderRefill { get; private set; } = new SoundPathSpecifier("/Audio/Effects/refill.ogg");
/// <summary>
/// When the welder is lit, this damage is added to the base melee weapon damage.

View File

@@ -3,7 +3,7 @@ using Content.Shared.Storage;
namespace Content.Server.Tools.Innate
{
[RegisterComponent]
public sealed class InnateToolComponent : Component
public sealed partial class InnateToolComponent : Component
{
[DataField("tools")] public List<EntitySpawnEntry> Tools = new();
public List<EntityUid> ToolUids = new();