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.Server.Station.Components;
/// </summary>
[RegisterComponent]
[Access(typeof(GameTicker))]
public sealed class BecomesStationComponent : Component
public sealed partial class BecomesStationComponent : Component
{
/// <summary>
/// Mapping only. Should use StationIds in all other

View File

@@ -10,7 +10,7 @@ namespace Content.Server.Station.Components;
/// All station entities will have this component.
/// </summary>
[RegisterComponent, Access(typeof(StationSystem))]
public sealed class StationDataComponent : Component
public sealed partial class StationDataComponent : Component
{
/// <summary>
/// The game map prototype, if any, associated with this station.
@@ -22,5 +22,5 @@ public sealed class StationDataComponent : Component
/// List of all grids this station is part of.
/// </summary>
[DataField("grids")]
public readonly HashSet<EntityUid> Grids = new();
public HashSet<EntityUid> Grids = new();
}

View File

@@ -4,7 +4,7 @@
/// This is used for event eligibility.
/// </summary>
[RegisterComponent]
public sealed class StationEventEligibleComponent : Component
public sealed partial class StationEventEligibleComponent : Component
{
}

View File

@@ -10,7 +10,7 @@ namespace Content.Server.Station.Components;
/// Stores information about a station's job selection.
/// </summary>
[RegisterComponent, Access(typeof(StationJobsSystem)), PublicAPI]
public sealed class StationJobsComponent : Component
public sealed partial class StationJobsComponent : Component
{
/// <summary>
/// Total *round-start* jobs at station start.
@@ -77,5 +77,5 @@ public sealed class StationJobsComponent : Component
[DataField("availableJobs", required: true,
customTypeSerializer: typeof(PrototypeIdDictionarySerializer<List<int?>, JobPrototype>))]
public readonly Dictionary<string, List<int?>> SetupAvailableJobs = default!;
public Dictionary<string, List<int?>> SetupAvailableJobs = default!;
}

View File

@@ -6,7 +6,7 @@ namespace Content.Server.Station.Components;
/// Indicates that a grid is a member of the given station.
/// </summary>
[RegisterComponent, Access(typeof(StationSystem))]
public sealed class StationMemberComponent : Component
public sealed partial class StationMemberComponent : Component
{
/// <summary>
/// Station that this grid is a part of.

View File

@@ -6,18 +6,18 @@ namespace Content.Server.Station.Components;
/// This is used for setting up a station's name.
/// </summary>
[RegisterComponent]
public sealed class StationNameSetupComponent : Component
public sealed partial class StationNameSetupComponent : Component
{
/// <summary>
/// The name template to use for the station.
/// If there's a name generator this should follow it's required format.
/// </summary>
[DataField("mapNameTemplate", required: true)]
public string StationNameTemplate { get; } = default!;
public string StationNameTemplate { get; private set; } = default!;
/// <summary>
/// Name generator to use for the station, if any.
/// </summary>
[DataField("nameGenerator")]
public StationNameGenerator? NameGenerator { get; }
public StationNameGenerator? NameGenerator { get; private set; }
}

View File

@@ -6,6 +6,6 @@ namespace Content.Server.Station.Components;
/// Controls spawning on the given station, tracking spawners present on it.
/// </summary>
[RegisterComponent, Access(typeof(StationSpawningSystem))]
public sealed class StationSpawningComponent : Component
public sealed partial class StationSpawningComponent : Component
{
}