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

@@ -9,7 +9,7 @@ namespace Content.Shared.Radio.Components;
/// It should be used for intercoms and other radios in future.
/// </summary>
[RegisterComponent]
public sealed class EncryptionKeyComponent : Component
public sealed partial class EncryptionKeyComponent : Component
{
[DataField("channels", customTypeSerializer: typeof(PrototypeIdHashSetSerializer<RadioChannelPrototype>))]
public HashSet<string> Channels = new();
@@ -18,5 +18,5 @@ public sealed class EncryptionKeyComponent : Component
/// This is the channel that will be used when using the default/department prefix (<see cref="SharedChatSystem.DefaultChannelKey"/>).
/// </summary>
[DataField("defaultChannel", customTypeSerializer: typeof(PrototypeIdSerializer<RadioChannelPrototype>))]
public readonly string? DefaultChannel;
public string? DefaultChannel;
}

View File

@@ -10,7 +10,7 @@ namespace Content.Shared.Radio.Components;
/// This component is by entities that can contain encryption keys
/// </summary>
[RegisterComponent]
public sealed class EncryptionKeyHolderComponent : Component
public sealed partial class EncryptionKeyHolderComponent : Component
{
/// <summary>
/// Whether or not encryption keys can be removed from the headset.

View File

@@ -6,7 +6,7 @@ namespace Content.Shared.Radio.Components;
/// This component relays radio messages to the parent entity's chat when equipped.
/// </summary>
[RegisterComponent]
public sealed class HeadsetComponent : Component
public sealed partial class HeadsetComponent : Component
{
[DataField("enabled")]
public bool Enabled = true;

View File

@@ -7,7 +7,7 @@ namespace Content.Shared.Radio.Components;
/// Handles intercom ui and is authoritative on the channels an intercom can access.
/// </summary>
[RegisterComponent, NetworkedComponent]
public sealed class IntercomComponent : Component
public sealed partial class IntercomComponent : Component
{
/// <summary>
/// Does this intercom require popwer to function

View File

@@ -1,12 +1,12 @@
namespace Content.Shared.Radio.Components;
/// <summary>
/// Entities with <see cref="TelecomServerComponent"/> are needed to transmit messages using headsets.
/// Entities with <see cref="TelecomServerComponent"/> are needed to transmit messages using headsets.
/// They also need to be powered by <see cref="ApcPowerReceiverComponent"/>
/// have <see cref="EncryptionKeyHolderComponent"/> and filled with encryption keys
/// of channels in order for them to work on the same map as server.
/// </summary>
[RegisterComponent]
public sealed class TelecomServerComponent : Component
public sealed partial class TelecomServerComponent : Component
{
}