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,6 +4,6 @@ namespace Content.Server.Shuttles.Components;
/// This is used for blacklisting entities from being on the arrivals shuttle when it goes FTL.
/// </summary>
[RegisterComponent]
public sealed class ArrivalsBlacklistComponent : Component
public sealed partial class ArrivalsBlacklistComponent : Component
{
}

View File

@@ -4,7 +4,7 @@ using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
namespace Content.Server.Shuttles.Components;
[RegisterComponent, Access(typeof(ArrivalsSystem))]
public sealed class ArrivalsShuttleComponent : Component
public sealed partial class ArrivalsShuttleComponent : Component
{
[DataField("station")]
public EntityUid Station;

View File

@@ -6,7 +6,7 @@ namespace Content.Server.Shuttles.Components;
/// Added to a designated arrivals station for players to spawn at, if enabled.
/// </summary>
[RegisterComponent, Access(typeof(ArrivalsSystem))]
public sealed class ArrivalsSourceComponent : Component
public sealed partial class ArrivalsSourceComponent : Component
{
}

View File

@@ -5,7 +5,7 @@ namespace Content.Server.Shuttles.Components;
/// We track it because checking every dock constantly would be expensive.
/// </summary>
[RegisterComponent]
public sealed class AutoDockComponent : Component
public sealed partial class AutoDockComponent : Component
{
/// <summary>
/// Track who has requested autodocking so we can know when to be removed.

View File

@@ -4,7 +4,7 @@ using Robust.Shared.Physics.Dynamics.Joints;
namespace Content.Server.Shuttles.Components
{
[RegisterComponent]
public sealed class DockingComponent : SharedDockingComponent
public sealed partial class DockingComponent : SharedDockingComponent
{
[DataField("dockedWith")]
public EntityUid? DockedWith;

View File

@@ -1,7 +1,7 @@
namespace Content.Server.Shuttles.Components;
[RegisterComponent]
public sealed class EmergencyShuttleConsoleComponent : Component
public sealed partial class EmergencyShuttleConsoleComponent : Component
{
// TODO: Okay doing it by string is kinda suss but also ID card tracking doesn't seem to be robust enough

View File

@@ -7,7 +7,7 @@ namespace Content.Server.Shuttles.Components;
/// If added to a grid gets launched when the emergency shuttle launches.
/// </summary>
[RegisterComponent, Access(typeof(EmergencyShuttleSystem))]
public sealed class EscapePodComponent : Component
public sealed partial class EscapePodComponent : Component
{
[DataField("launchTime", customTypeSerializer:typeof(TimeOffsetSerializer))]
public TimeSpan? LaunchTime;

View File

@@ -10,7 +10,7 @@ namespace Content.Server.Shuttles.Components;
/// Added to a component when it is queued or is travelling via FTL.
/// </summary>
[RegisterComponent]
public sealed class FTLComponent : Component
public sealed partial class FTLComponent : Component
{
[ViewVariables]
public FTLState State = FTLState.Available;

View File

@@ -3,7 +3,7 @@ using Content.Shared.Whitelist;
namespace Content.Server.Shuttles.Components;
[RegisterComponent]
public sealed class FTLDestinationComponent : Component
public sealed partial class FTLDestinationComponent : Component
{
/// <summary>
/// Should this destination be restricted in some form from console visibility.

View File

@@ -7,7 +7,7 @@ namespace Content.Server.Shuttles.Components;
/// If added to an airlock will try to autofill a grid onto it on MapInit
/// </summary>
[RegisterComponent, Access(typeof(ShuttleSystem))]
public sealed class GridFillComponent : Component
public sealed partial class GridFillComponent : Component
{
[DataField("path")] public ResPath Path = new("/Maps/Shuttles/escape_pod_small.yml");
}

View File

@@ -7,7 +7,7 @@ namespace Content.Server.Shuttles.Components;
/// Similar to <see cref="GridFillComponent"/> except spawns the grid near to the station.
/// </summary>
[RegisterComponent, Access(typeof(ShuttleSystem))]
public sealed class GridSpawnComponent : Component
public sealed partial class GridSpawnComponent : Component
{
[DataField("paths", required: true)] public List<ResPath> Paths = new();
}

View File

@@ -4,7 +4,7 @@ using Content.Shared.Shuttles.Components;
namespace Content.Server.Shuttles.Components;
[RegisterComponent, Access(typeof(ShuttleSystem))]
public sealed class IFFConsoleComponent : Component
public sealed partial class IFFConsoleComponent : Component
{
/// <summary>
/// Flags that this console is allowed to set.

View File

@@ -4,7 +4,7 @@ namespace Content.Server.Shuttles.Components;
/// Added to arrivals latejoins until they have arrived at the station.
/// </summary>
[RegisterComponent]
public sealed class PendingClockInComponent : Component
public sealed partial class PendingClockInComponent : Component
{
}

View File

@@ -7,7 +7,7 @@ namespace Content.Server.Shuttles.Components;
/// Given priority when considering where to dock.
/// </summary>
[RegisterComponent]
public sealed class PriorityDockComponent : Component
public sealed partial class PriorityDockComponent : Component
{
/// <summary>
/// Tag to match on the docking request, if this dock is to be prioritised.

View File

@@ -5,7 +5,7 @@ namespace Content.Server.Shuttles.Components;
/// This checks for whether they've left the specified radius before allowing them to automatically dock again.
/// </summary>
[RegisterComponent]
public sealed class RecentlyDockedComponent : Component
public sealed partial class RecentlyDockedComponent : Component
{
[DataField("lastDocked")]
public EntityUid LastDocked;

View File

@@ -3,7 +3,7 @@ using System.Numerics;
namespace Content.Server.Shuttles.Components
{
[RegisterComponent]
public sealed class ShuttleComponent : Component
public sealed partial class ShuttleComponent : Component
{
[ViewVariables]
public bool Enabled = true;

View File

@@ -4,7 +4,7 @@ using Content.Shared.Shuttles.Components;
namespace Content.Server.Shuttles.Components
{
[RegisterComponent]
public sealed class ShuttleConsoleComponent : SharedShuttleConsoleComponent
public sealed partial class ShuttleConsoleComponent : SharedShuttleConsoleComponent
{
[ViewVariables]
public readonly List<EntityUid> SubscribedPilots = new();

View File

@@ -5,4 +5,4 @@ namespace Content.Server.Shuttles.Components;
/// Useful for small, unimportant items like bullets to avoid generating many contacts.
/// </summary>
[RegisterComponent]
public sealed class SpaceGarbageComponent : Component {}
public sealed partial class SpaceGarbageComponent : Component {}

View File

@@ -7,7 +7,7 @@ namespace Content.Server.Shuttles.Components;
/// Added to a station that is available for arrivals shuttles.
/// </summary>
[RegisterComponent, Access(typeof(ArrivalsSystem))]
public sealed class StationArrivalsComponent : Component
public sealed partial class StationArrivalsComponent : Component
{
[DataField("shuttle")]
public EntityUid Shuttle;

View File

@@ -7,7 +7,7 @@ namespace Content.Server.Shuttles.Components;
/// Spawns Central Command (emergency destination) for a station.
/// </summary>
[RegisterComponent]
public sealed class StationCentcommComponent : Component
public sealed partial class StationCentcommComponent : Component
{
/// <summary>
/// Crude shuttle offset spawning.

View File

@@ -8,7 +8,7 @@ namespace Content.Server.Shuttles.Components;
/// This is used for controlling evacuation for a station.
/// </summary>
[RegisterComponent]
public sealed class StationEmergencyShuttleComponent : Component
public sealed partial class StationEmergencyShuttleComponent : Component
{
/// <summary>
/// The emergency shuttle assigned to this station.

View File

@@ -10,7 +10,7 @@ namespace Content.Server.Shuttles.Components
{
[RegisterComponent, NetworkedComponent]
[Access(typeof(ThrusterSystem))]
public sealed class ThrusterComponent : Component
public sealed partial class ThrusterComponent : Component
{
/// <summary>
/// Whether the thruster has been force to be enabled / disabled (e.g. VV, interaction, etc.)