From b9337693d31c09a125789eda8f5c433ccea4008b Mon Sep 17 00:00:00 2001 From: Tayrtahn Date: Thu, 15 May 2025 14:30:50 -0400 Subject: [PATCH] Fix prototypes and datadefs so they pass analyzer checks (again) (#37485) Fix prototypes so they pass analyzer checks (again) --- Content.Shared/Anomaly/SharedAnomalySystem.cs | 2 +- Content.Shared/Cargo/Prototypes/CargoAccountPrototype.cs | 2 +- .../CartridgeLoader/Cartridges/NanoTaskUiMessageEvent.cs | 8 ++++---- .../CartridgeLoader/Cartridges/NanoTaskUiState.cs | 4 ++-- Content.Shared/Cloning/CloningSettingsPrototype.cs | 4 ++-- Content.Shared/RCD/RCDPrototype.cs | 2 +- .../StationAi/StationAiCustomizationGroupPrototype.cs | 2 +- .../Silicons/StationAi/StationAiCustomizationPrototype.cs | 6 +++--- .../Artifact/Prototypes/XenoArchTriggerPrototype.cs | 2 +- 9 files changed, 16 insertions(+), 16 deletions(-) diff --git a/Content.Shared/Anomaly/SharedAnomalySystem.cs b/Content.Shared/Anomaly/SharedAnomalySystem.cs index b36fec7a02..3d00d43f41 100644 --- a/Content.Shared/Anomaly/SharedAnomalySystem.cs +++ b/Content.Shared/Anomaly/SharedAnomalySystem.cs @@ -444,7 +444,7 @@ public abstract class SharedAnomalySystem : EntitySystem } [DataRecord] -public record struct AnomalySpawnSettings() +public partial record struct AnomalySpawnSettings() { /// /// should entities block spawning? diff --git a/Content.Shared/Cargo/Prototypes/CargoAccountPrototype.cs b/Content.Shared/Cargo/Prototypes/CargoAccountPrototype.cs index c1c474abf8..6d5fc3ebfc 100644 --- a/Content.Shared/Cargo/Prototypes/CargoAccountPrototype.cs +++ b/Content.Shared/Cargo/Prototypes/CargoAccountPrototype.cs @@ -11,7 +11,7 @@ public sealed partial class CargoAccountPrototype : IPrototype { /// [IdDataField] - public string ID { get; } = default!; + public string ID { get; private set; } = default!; /// /// Full IC name of the account. diff --git a/Content.Shared/CartridgeLoader/Cartridges/NanoTaskUiMessageEvent.cs b/Content.Shared/CartridgeLoader/Cartridges/NanoTaskUiMessageEvent.cs index 51a34aaa75..b78525bd7f 100644 --- a/Content.Shared/CartridgeLoader/Cartridges/NanoTaskUiMessageEvent.cs +++ b/Content.Shared/CartridgeLoader/Cartridges/NanoTaskUiMessageEvent.cs @@ -13,7 +13,7 @@ public interface INanoTaskUiMessagePayload /// Dispatched when a new task is created /// [Serializable, NetSerializable, DataRecord] -public sealed class NanoTaskAddTask : INanoTaskUiMessagePayload +public sealed partial class NanoTaskAddTask : INanoTaskUiMessagePayload { /// /// The newly created task @@ -30,7 +30,7 @@ public sealed class NanoTaskAddTask : INanoTaskUiMessagePayload /// Dispatched when an existing task is modified /// [Serializable, NetSerializable, DataRecord] -public sealed class NanoTaskUpdateTask : INanoTaskUiMessagePayload +public sealed partial class NanoTaskUpdateTask : INanoTaskUiMessagePayload { /// /// The task that was updated and its ID @@ -47,7 +47,7 @@ public sealed class NanoTaskUpdateTask : INanoTaskUiMessagePayload /// Dispatched when an existing task is deleted /// [Serializable, NetSerializable, DataRecord] -public sealed class NanoTaskDeleteTask : INanoTaskUiMessagePayload +public sealed partial class NanoTaskDeleteTask : INanoTaskUiMessagePayload { /// /// The ID of the task to delete @@ -64,7 +64,7 @@ public sealed class NanoTaskDeleteTask : INanoTaskUiMessagePayload /// Dispatched when a task is requested to be printed /// [Serializable, NetSerializable, DataRecord] -public sealed class NanoTaskPrintTask : INanoTaskUiMessagePayload +public sealed partial class NanoTaskPrintTask : INanoTaskUiMessagePayload { /// /// The NanoTask to print diff --git a/Content.Shared/CartridgeLoader/Cartridges/NanoTaskUiState.cs b/Content.Shared/CartridgeLoader/Cartridges/NanoTaskUiState.cs index 9f270671e3..3c65adac65 100644 --- a/Content.Shared/CartridgeLoader/Cartridges/NanoTaskUiState.cs +++ b/Content.Shared/CartridgeLoader/Cartridges/NanoTaskUiState.cs @@ -17,7 +17,7 @@ public enum NanoTaskPriority : byte /// The data relating to a single NanoTask item, but not its identifier /// [Serializable, NetSerializable, DataRecord] -public sealed class NanoTaskItem +public sealed partial class NanoTaskItem { /// /// The maximum length of the Description and TaskIsFor fields @@ -61,7 +61,7 @@ public sealed class NanoTaskItem /// Pairs a NanoTask item and its identifier /// [Serializable, NetSerializable, DataRecord] -public sealed class NanoTaskItemAndId +public sealed partial class NanoTaskItemAndId { public readonly int Id; public readonly NanoTaskItem Data; diff --git a/Content.Shared/Cloning/CloningSettingsPrototype.cs b/Content.Shared/Cloning/CloningSettingsPrototype.cs index 8cd22f1167..b422f7188b 100644 --- a/Content.Shared/Cloning/CloningSettingsPrototype.cs +++ b/Content.Shared/Cloning/CloningSettingsPrototype.cs @@ -19,11 +19,11 @@ public sealed partial class CloningSettingsPrototype : IPrototype, IInheritingPr public string ID { get; private set; } = default!; [ParentDataField(typeof(PrototypeIdArraySerializer))] - public string[]? Parents { get; } + public string[]? Parents { get; private set; } [AbstractDataField] [NeverPushInheritance] - public bool Abstract { get; } + public bool Abstract { get; private set; } /// /// Determines if cloning can be prevented by traits etc. diff --git a/Content.Shared/RCD/RCDPrototype.cs b/Content.Shared/RCD/RCDPrototype.cs index b00f59f049..2be5e1c776 100644 --- a/Content.Shared/RCD/RCDPrototype.cs +++ b/Content.Shared/RCD/RCDPrototype.cs @@ -9,7 +9,7 @@ namespace Content.Shared.RCD; /// Contains the parameters for an RCD construction / operation /// [Prototype("rcd")] -public sealed class RCDPrototype : IPrototype +public sealed partial class RCDPrototype : IPrototype { [IdDataField] public string ID { get; private set; } = default!; diff --git a/Content.Shared/Silicons/StationAi/StationAiCustomizationGroupPrototype.cs b/Content.Shared/Silicons/StationAi/StationAiCustomizationGroupPrototype.cs index bbb687e636..590043e271 100644 --- a/Content.Shared/Silicons/StationAi/StationAiCustomizationGroupPrototype.cs +++ b/Content.Shared/Silicons/StationAi/StationAiCustomizationGroupPrototype.cs @@ -9,7 +9,7 @@ namespace Content.Shared.Silicons.StationAi; public sealed partial class StationAiCustomizationGroupPrototype : IPrototype { [IdDataField] - public string ID { get; } = string.Empty; + public string ID { get; private set; } = string.Empty; /// /// The localized name of the customization. diff --git a/Content.Shared/Silicons/StationAi/StationAiCustomizationPrototype.cs b/Content.Shared/Silicons/StationAi/StationAiCustomizationPrototype.cs index 5fe3891b0d..eae6f51477 100644 --- a/Content.Shared/Silicons/StationAi/StationAiCustomizationPrototype.cs +++ b/Content.Shared/Silicons/StationAi/StationAiCustomizationPrototype.cs @@ -11,7 +11,7 @@ namespace Content.Shared.Silicons.StationAi; public sealed partial class StationAiCustomizationPrototype : IPrototype, IInheritingPrototype { [IdDataField] - public string ID { get; } = string.Empty; + public string ID { get; private set; } = string.Empty; /// /// The (unlocalized) name of the customization. @@ -42,7 +42,7 @@ public sealed partial class StationAiCustomizationPrototype : IPrototype, IInher /// [ViewVariables] [ParentDataFieldAttribute(typeof(AbstractPrototypeIdArraySerializer))] - public string[]? Parents { get; } + public string[]? Parents { get; private set; } /// /// Specifies whether the prototype is abstract. @@ -50,5 +50,5 @@ public sealed partial class StationAiCustomizationPrototype : IPrototype, IInher [ViewVariables] [NeverPushInheritance] [AbstractDataField] - public bool Abstract { get; } + public bool Abstract { get; private set; } } diff --git a/Content.Shared/Xenoarchaeology/Artifact/Prototypes/XenoArchTriggerPrototype.cs b/Content.Shared/Xenoarchaeology/Artifact/Prototypes/XenoArchTriggerPrototype.cs index 74d3895234..fc59b966aa 100644 --- a/Content.Shared/Xenoarchaeology/Artifact/Prototypes/XenoArchTriggerPrototype.cs +++ b/Content.Shared/Xenoarchaeology/Artifact/Prototypes/XenoArchTriggerPrototype.cs @@ -11,7 +11,7 @@ public sealed partial class XenoArchTriggerPrototype : IPrototype { /// [IdDataField] - public string ID { get; } = default!; + public string ID { get; private set; } = default!; /// /// Tip for user on how to activate this trigger. -- 2.51.2