Refactor serialization copying to use source generators (#19412)
This commit is contained in:
@@ -6,7 +6,7 @@ namespace Content.Server.Speech.Components;
|
||||
/// This component is used to relay speech events to other systems.
|
||||
/// </summary>
|
||||
[RegisterComponent]
|
||||
public sealed class ActiveListenerComponent : Component
|
||||
public sealed partial class ActiveListenerComponent : Component
|
||||
{
|
||||
[DataField("range")]
|
||||
public float Range = ChatSystem.VoiceRange;
|
||||
|
||||
@@ -6,7 +6,7 @@ namespace Content.Server.Speech.Components;
|
||||
/// Applies accent to user while they wear entity as a clothing.
|
||||
/// </summary>
|
||||
[RegisterComponent]
|
||||
public sealed class AddAccentClothingComponent : Component
|
||||
public sealed partial class AddAccentClothingComponent : Component
|
||||
{
|
||||
/// <summary>
|
||||
/// Component name for accent that will be applied.
|
||||
|
||||
@@ -4,11 +4,11 @@ namespace Content.Server.Speech.Components;
|
||||
|
||||
[RegisterComponent]
|
||||
[Access(typeof(ArchaicAccentSystem))]
|
||||
public sealed class ArchaicAccentComponent : Component
|
||||
public sealed partial class ArchaicAccentComponent : Component
|
||||
{
|
||||
[ViewVariables(VVAccess.ReadWrite)]
|
||||
[DataField("forsoothChance")]
|
||||
public readonly float ForsoothChance = 0.15f;
|
||||
public float ForsoothChance = 0.15f;
|
||||
|
||||
[ViewVariables]
|
||||
public readonly List<string> ArchaicWords = new()
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
namespace Content.Server.Speech.Components
|
||||
{
|
||||
[RegisterComponent]
|
||||
public sealed class BackwardsAccentComponent : Component
|
||||
public sealed partial class BackwardsAccentComponent : Component
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
/// Hiss!
|
||||
/// </summary>
|
||||
[RegisterComponent]
|
||||
public sealed class LizardAccentComponent : Component
|
||||
public sealed partial class LizardAccentComponent : Component
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
/// Etc etc.
|
||||
/// </summary>
|
||||
[RegisterComponent]
|
||||
public sealed class MobsterAccentComponent : Component
|
||||
public sealed partial class MobsterAccentComponent : Component
|
||||
{
|
||||
/// <summary>
|
||||
/// Do you make all the rules?
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace Content.Server.Speech.Components;
|
||||
|
||||
[RegisterComponent]
|
||||
public sealed class MonkeyAccentComponent : Component {}
|
||||
public sealed partial class MonkeyAccentComponent : Component {}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
namespace Content.Server.Speech.Components
|
||||
{
|
||||
[RegisterComponent]
|
||||
public sealed class OwOAccentComponent : Component
|
||||
public sealed partial class OwOAccentComponent : Component
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,11 +4,11 @@ namespace Content.Server.Speech.Components;
|
||||
|
||||
[RegisterComponent]
|
||||
[Access(typeof(PirateAccentSystem))]
|
||||
public sealed class PirateAccentComponent : Component
|
||||
public sealed partial class PirateAccentComponent : Component
|
||||
{
|
||||
[ViewVariables(VVAccess.ReadWrite)]
|
||||
[DataField("yarrChance")]
|
||||
public readonly float YarrChance = 0.5f;
|
||||
public float YarrChance = 0.5f;
|
||||
|
||||
[ViewVariables]
|
||||
public readonly List<string> PirateWords = new()
|
||||
|
||||
@@ -8,7 +8,7 @@ namespace Content.Server.Speech.Components
|
||||
{
|
||||
[ViewVariables]
|
||||
[IdDataField]
|
||||
public string ID { get; } = default!;
|
||||
public string ID { get; private set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// If this array is non-null, the full text of anything said will be randomly replaced with one of these words.
|
||||
@@ -28,7 +28,7 @@ namespace Content.Server.Speech.Components
|
||||
/// Replaces full sentences or words within sentences with new strings.
|
||||
/// </summary>
|
||||
[RegisterComponent]
|
||||
public sealed class ReplacementAccentComponent : Component
|
||||
public sealed partial class ReplacementAccentComponent : Component
|
||||
{
|
||||
[DataField("accent", customTypeSerializer: typeof(PrototypeIdSerializer<ReplacementAccentPrototype>), required: true)]
|
||||
public string Accent = default!;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace Content.Server.Speech.Components;
|
||||
|
||||
[RegisterComponent]
|
||||
public sealed class RussianAccentComponent : Component {}
|
||||
public sealed partial class RussianAccentComponent : Component {}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
namespace Content.Server.Speech.Components
|
||||
{
|
||||
[RegisterComponent]
|
||||
public sealed class ScrambledAccentComponent : Component
|
||||
public sealed partial class ScrambledAccentComponent : Component
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
/// Rattle me bones!
|
||||
/// </summary>
|
||||
[RegisterComponent]
|
||||
public sealed class SkeletonAccentComponent : Component
|
||||
public sealed partial class SkeletonAccentComponent : Component
|
||||
{
|
||||
/// <summary>
|
||||
/// Chance that the message will be appended with "ACK ACK!"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace Content.Server.Speech.Components;
|
||||
|
||||
[RegisterComponent]
|
||||
public sealed class SlurredAccentComponent : Component { }
|
||||
public sealed partial class SlurredAccentComponent : Component { }
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
namespace Content.Server.Speech.Components
|
||||
{
|
||||
[RegisterComponent]
|
||||
public sealed class SpanishAccentComponent : Component
|
||||
public sealed partial class SpanishAccentComponent : Component
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
namespace Content.Server.Speech.Components
|
||||
{
|
||||
[RegisterComponent]
|
||||
public sealed class StutteringAccentComponent : Component
|
||||
public sealed partial class StutteringAccentComponent : Component
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ namespace Content.Server.Speech.Components;
|
||||
/// </summary>
|
||||
[RegisterComponent]
|
||||
[Access(typeof(VocalSystem))]
|
||||
public sealed class VocalComponent : Component
|
||||
public sealed partial class VocalComponent : Component
|
||||
{
|
||||
/// <summary>
|
||||
/// Emote sounds prototype id for each sex (not gender).
|
||||
@@ -47,7 +47,7 @@ public sealed class VocalComponent : Component
|
||||
public EmoteSoundsPrototype? EmoteSounds = null;
|
||||
}
|
||||
|
||||
public sealed class ScreamActionEvent : InstantActionEvent
|
||||
public sealed partial class ScreamActionEvent : InstantActionEvent
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user