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

@@ -5,7 +5,7 @@
/// Kill everybody else to win.
/// </summary>
[RegisterComponent, Access(typeof(DeathMatchRuleSystem))]
public sealed class DeathMatchRuleComponent : Component
public sealed partial class DeathMatchRuleComponent : Component
{
/// <summary>
/// How long until the round restarts

View File

@@ -5,7 +5,7 @@
/// Used to both track the entity as well as store basic data
/// </summary>
[RegisterComponent]
public sealed class GameRuleComponent : Component
public sealed partial class GameRuleComponent : Component
{
/// <summary>
/// Whether or not the rule is active.

View File

@@ -6,7 +6,7 @@ namespace Content.Server.GameTicking.Rules.Components;
/// Gamerule that ends the round after a period of inactivity.
/// </summary>
[RegisterComponent, Access(typeof(InactivityTimeRestartRuleSystem))]
public sealed class InactivityRuleComponent : Component
public sealed partial class InactivityRuleComponent : Component
{
/// <summary>
/// How long the round must be inactive to restart

View File

@@ -6,7 +6,7 @@ namespace Content.Server.GameTicking.Rules.Components;
/// Configures the <see cref="InactivityTimeRestartRuleSystem"/> game rule.
/// </summary>
[RegisterComponent]
public sealed class MaxTimeRestartRuleComponent : Component
public sealed partial class MaxTimeRestartRuleComponent : Component
{
/// <summary>
/// The max amount of time the round can last

View File

@@ -6,7 +6,7 @@ namespace Content.Server.GameTicking.Rules.Components;
/// This is used for tagging a mob as a nuke operative.
/// </summary>
[RegisterComponent]
public sealed class NukeOperativeComponent : Component
public sealed partial class NukeOperativeComponent : Component
{
/// <summary>
/// Path to antagonist alert sound.

View File

@@ -9,7 +9,7 @@ namespace Content.Server.GameTicking.Rules.Components;
/// TODO: Remove once systems can request spawns from the ghost role system directly.
/// </summary>
[RegisterComponent]
public sealed class NukeOperativeSpawnerComponent : Component
public sealed partial class NukeOperativeSpawnerComponent : Component
{
[DataField("name", required:true)]
public string OperativeName = default!;

View File

@@ -15,7 +15,7 @@ using Robust.Shared.Utility;
namespace Content.Server.GameTicking.Rules.Components;
[RegisterComponent, Access(typeof(NukeopsRuleSystem), typeof(LoneOpsSpawnRule))]
public sealed class NukeopsRuleComponent : Component
public sealed partial class NukeopsRuleComponent : Component
{
/// <summary>
/// The minimum needed amount of players
@@ -98,19 +98,19 @@ public sealed class NukeopsRuleComponent : Component
/// Cached starting gear prototypes.
/// </summary>
[DataField("startingGearPrototypes")]
public readonly Dictionary<string, StartingGearPrototype> StartingGearPrototypes = new ();
public Dictionary<string, StartingGearPrototype> StartingGearPrototypes = new ();
/// <summary>
/// Cached operator name prototypes.
/// </summary>
[DataField("operativeNames")]
public readonly Dictionary<string, List<string>> OperativeNames = new();
public Dictionary<string, List<string>> OperativeNames = new();
/// <summary>
/// Data to be used in <see cref="OnMindAdded"/> for an operative once the Mind has been added.
/// </summary>
[DataField("operativeMindPendingData")]
public readonly Dictionary<EntityUid, string> OperativeMindPendingData = new();
public Dictionary<EntityUid, string> OperativeMindPendingData = new();
/// <summary>
/// Players who played as an operative at some point in the round.
@@ -118,7 +118,7 @@ public sealed class NukeopsRuleComponent : Component
/// </summary>
/// todo: don't store sessions, dingus
[DataField("operativePlayers")]
public readonly Dictionary<string, IPlayerSession> OperativePlayers = new();
public Dictionary<string, IPlayerSession> OperativePlayers = new();
[DataField("faction", customTypeSerializer: typeof(PrototypeIdSerializer<NpcFactionPrototype>), required: true)]
public string Faction = default!;

View File

@@ -3,7 +3,7 @@
namespace Content.Server.GameTicking.Rules.Components;
[RegisterComponent, Access(typeof(PiratesRuleSystem))]
public sealed class PiratesRuleComponent : Component
public sealed partial class PiratesRuleComponent : Component
{
[ViewVariables]
public List<Mind.Mind> Pirates = new();
@@ -18,7 +18,7 @@ public sealed class PiratesRuleComponent : Component
/// Path to antagonist alert sound.
/// </summary>
[DataField("pirateAlertSound")]
public readonly SoundSpecifier PirateAlertSound = new SoundPathSpecifier(
public SoundSpecifier PirateAlertSound = new SoundPathSpecifier(
"/Audio/Ambience/Antag/pirate_start.ogg",
AudioParams.Default.WithVolume(4));
}

View File

@@ -1,7 +1,7 @@
namespace Content.Server.GameTicking.Rules.Components;
[RegisterComponent, Access(typeof(SandboxRuleSystem))]
public sealed class SandboxRuleComponent : Component
public sealed partial class SandboxRuleComponent : Component
{
}

View File

@@ -1,7 +1,7 @@
namespace Content.Server.GameTicking.Rules.Components;
[RegisterComponent, Access(typeof(SecretRuleSystem))]
public sealed class SecretRuleComponent : Component
public sealed partial class SecretRuleComponent : Component
{
/// <summary>
/// The gamerules that get added by secret.

View File

@@ -8,7 +8,7 @@ using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototy
namespace Content.Server.GameTicking.Rules.Components;
[RegisterComponent, Access(typeof(TraitorRuleSystem))]
public sealed class TraitorRuleComponent : Component
public sealed partial class TraitorRuleComponent : Component
{
public List<TraitorRole> Traitors = new();

View File

@@ -7,7 +7,7 @@ using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototy
namespace Content.Server.GameTicking.Rules.Components;
[RegisterComponent, Access(typeof(ZombieRuleSystem))]
public sealed class ZombieRuleComponent : Component
public sealed partial class ZombieRuleComponent : Component
{
[DataField("initialInfectedNames")]
public Dictionary<string, string> InitialInfectedNames = new();