Skip to content

Commit

Permalink
Make all prototype types partial (space-wizards#21374)
Browse files Browse the repository at this point in the history
  • Loading branch information
DrSmugleaf authored Nov 2, 2023
1 parent aa0c3b6 commit 2d58d19
Show file tree
Hide file tree
Showing 105 changed files with 111 additions and 126 deletions.
7 changes: 1 addition & 6 deletions Content.Client/Parallax/Data/ParallaxPrototype.cs
Original file line number Diff line number Diff line change
@@ -1,17 +1,12 @@
using System.Collections.Generic;
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization.Manager.Attributes;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.Dictionary;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.List;
using Robust.Shared.Utility;

namespace Content.Client.Parallax.Data;

/// <summary>
/// Prototype data for a parallax.
/// </summary>
[Prototype("parallax")]
public sealed class ParallaxPrototype : IPrototype
public sealed partial class ParallaxPrototype : IPrototype
{
/// <inheritdoc/>
[IdDataField]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace Content.Server.Advertisements
{
[Serializable, Prototype("advertisementsPack")]
public sealed class AdvertisementsPackPrototype : IPrototype
public sealed partial class AdvertisementsPackPrototype : IPrototype
{
[ViewVariables]
[IdDataField]
Expand Down
2 changes: 1 addition & 1 deletion Content.Server/AlertLevel/AlertLevelPrototype.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
namespace Content.Server.AlertLevel;

[Prototype("alertLevels")]
public sealed class AlertLevelPrototype : IPrototype
public sealed partial class AlertLevelPrototype : IPrototype
{
[IdDataField] public string ID { get; } = default!;

Expand Down
4 changes: 1 addition & 3 deletions Content.Server/Announcements/RoundAnnouncementPrototype.cs
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
using Content.Server.GameTicking.Presets;
using Robust.Shared.Audio;
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.List;

namespace Content.Server.Announcements;

/// <summary>
/// Used for any announcements on the start of a round.
/// </summary>
[Prototype("roundAnnouncement")]
public sealed class RoundAnnouncementPrototype : IPrototype
public sealed partial class RoundAnnouncementPrototype : IPrototype
{
[IdDataField]
public string ID { get; private set; } = default!;
Expand Down
2 changes: 1 addition & 1 deletion Content.Server/Atmos/Reactions/GasReactionPrototype.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public enum GasReaction : byte
}

[Prototype("gasReaction")]
public sealed class GasReactionPrototype : IPrototype
public sealed partial class GasReactionPrototype : IPrototype
{
[ViewVariables]
[IdDataField]
Expand Down
2 changes: 1 addition & 1 deletion Content.Server/GameTicking/Presets/GamePresetPrototype.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace Content.Server.GameTicking.Presets
/// A round-start setup preset, such as which antagonists to spawn.
/// </summary>
[Prototype("gamePreset")]
public sealed class GamePresetPrototype : IPrototype
public sealed partial class GamePresetPrototype : IPrototype
{
[IdDataField]
public string ID { get; private set; } = default!;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace Content.Server.GameTicking.Prototypes;
/// Prototype for a lobby background the game can choose.
/// </summary>
[Prototype("lobbyBackground")]
public sealed class LobbyBackgroundPrototype : IPrototype
public sealed partial class LobbyBackgroundPrototype : IPrototype
{
/// <inheritdoc/>
[IdDataField]
Expand Down
2 changes: 1 addition & 1 deletion Content.Server/GameTicking/Rules/GameRulePrototype.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ namespace Content.Server.GameTicking.Rules;

/*
[Prototype("gameRule")]
public sealed class GameRulePrototype : IPrototype
public sealed partial class GameRulePrototype : IPrototype
{
[IdDataField]
public string ID { get; private set; } = default!;
Expand Down
2 changes: 1 addition & 1 deletion Content.Server/Holiday/HolidayPrototype.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
namespace Content.Server.Holiday
{
[Prototype("holiday")]
public sealed class HolidayPrototype : IPrototype
public sealed partial class HolidayPrototype : IPrototype
{
[DataField("name")] public string Name { get; private set; } = string.Empty;

Expand Down
2 changes: 1 addition & 1 deletion Content.Server/Maps/GameMapPoolPrototype.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace Content.Server.Maps;
/// Prototype that holds a pool of maps that can be indexed based on the map pool CCVar.
/// </summary>
[Prototype("gameMapPool"), PublicAPI]
public sealed class GameMapPoolPrototype : IPrototype
public sealed partial class GameMapPoolPrototype : IPrototype
{
/// <inheritdoc/>
[IdDataField]
Expand Down
2 changes: 1 addition & 1 deletion Content.Server/NPC/Components/NpcFactionPrototype.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace Content.Server.NPC.Components
/// Contains data about this faction's relations with other factions.
/// </summary>
[Prototype("npcFaction")]
public sealed class NpcFactionPrototype : IPrototype
public sealed partial class NpcFactionPrototype : IPrototype
{
[ViewVariables]
[IdDataField]
Expand Down
2 changes: 1 addition & 1 deletion Content.Server/NPC/HTN/HTNCompoundPrototype.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ namespace Content.Server.NPC.HTN;
/// Represents a network of multiple tasks. This gets expanded out to its relevant nodes.
/// </summary>
[Prototype("htnCompound")]
public sealed class HTNCompoundPrototype : IPrototype
public sealed partial class HTNCompoundPrototype : IPrototype
{
[IdDataField] public string ID { get; } = string.Empty;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace Content.Server.NPC.Queries.Curves;

[Prototype("utilityCurvePreset")]
public sealed class UtilityCurvePresetPrototype : IPrototype
public sealed partial class UtilityCurvePresetPrototype : IPrototype
{
[IdDataField] public string ID { get; } = string.Empty;

Expand Down
2 changes: 1 addition & 1 deletion Content.Server/NPC/Queries/UtilityQueryPrototype.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace Content.Server.NPC.Queries;
/// These results are then run through the considerations.
/// </summary>
[Prototype("utilityQuery")]
public sealed class UtilityQueryPrototype : IPrototype
public sealed partial class UtilityQueryPrototype : IPrototype
{
[IdDataField]
public string ID { get; private set; } = default!;
Expand Down
2 changes: 1 addition & 1 deletion Content.Server/Salvage/SalvageMapPrototype.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
namespace Content.Server.Salvage;

[Prototype("salvageMap")]
public sealed class SalvageMapPrototype : IPrototype
public sealed partial class SalvageMapPrototype : IPrototype
{
[ViewVariables] [IdDataField] public string ID { get; } = default!;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
namespace Content.Server.Speech.Components
{
[Prototype("accent")]
public sealed class ReplacementAccentPrototype : IPrototype
public sealed partial class ReplacementAccentPrototype : IPrototype
{
[ViewVariables]
[IdDataField]
Expand Down
3 changes: 1 addition & 2 deletions Content.Server/Wires/WireLayout.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.Array;

namespace Content.Server.Wires;
Expand All @@ -12,7 +11,7 @@ namespace Content.Server.Wires;
/// WiresSystem as a functional wire set.
/// </summary>
[Prototype("wireLayout")]
public sealed class WireLayoutPrototype : IPrototype, IInheritingPrototype
public sealed partial class WireLayoutPrototype : IPrototype, IInheritingPrototype
{
[IdDataField]
public string ID { get; private set; } = default!;
Expand Down
2 changes: 1 addition & 1 deletion Content.Server/Worldgen/Prototypes/BiomePrototype.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace Content.Server.Worldgen.Prototypes;
/// of noise channels at that location.
/// </summary>
[Prototype("spaceBiome")]
public sealed class BiomePrototype : IPrototype, IInheritingPrototype
public sealed partial class BiomePrototype : IPrototype, IInheritingPrototype
{
/// <inheritdoc />
[ParentDataField(typeof(AbstractPrototypeIdArraySerializer<EntityPrototype>))]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace Content.Server.Worldgen.Prototypes;
/// The components included are applied to the map that world generation is configured on.
/// </summary>
[Prototype("worldgenConfig")]
public sealed class WorldgenConfigPrototype : IPrototype
public sealed partial class WorldgenConfigPrototype : IPrototype
{
/// <inheritdoc />
[IdDataField]
Expand Down
2 changes: 1 addition & 1 deletion Content.Shared/Access/AccessGroupPrototype.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ namespace Content.Shared.Access;
/// Used by <see cref="AccessComponent"/> to avoid boilerplate.
/// </summary>
[Prototype("accessGroup")]
public sealed class AccessGroupPrototype : IPrototype
public sealed partial class AccessGroupPrototype : IPrototype
{
[IdDataField]
public string ID { get; private set; } = default!;
Expand Down
2 changes: 1 addition & 1 deletion Content.Shared/Access/AccessLevelPrototype.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ namespace Content.Shared.Access
/// Defines a single access level that can be stored on ID cards and checked for.
/// </summary>
[Prototype("accessLevel")]
public sealed class AccessLevelPrototype : IPrototype
public sealed partial class AccessLevelPrototype : IPrototype
{
[ViewVariables]
[IdDataField]
Expand Down
2 changes: 1 addition & 1 deletion Content.Shared/Alert/AlertPrototype.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace Content.Shared.Alert
/// An alert popup with associated icon, tooltip, and other data.
/// </summary>
[Prototype("alert")]
public sealed class AlertPrototype : IPrototype, ISerializationHooks
public sealed partial class AlertPrototype : IPrototype, ISerializationHooks
{
[ViewVariables]
string IPrototype.ID => AlertType.ToString();
Expand Down
2 changes: 1 addition & 1 deletion Content.Shared/Atmos/Monitor/AtmosAlarmThreshold.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ namespace Content.Shared.Atmos.Monitor;


[Prototype("alarmThreshold")]
public sealed class AtmosAlarmThresholdPrototype : IPrototype
public sealed partial class AtmosAlarmThresholdPrototype : IPrototype
{
[IdDataField]
public string ID { get; private set; } = default!;
Expand Down
2 changes: 1 addition & 1 deletion Content.Shared/Atmos/Prototypes/GasPrototype.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
namespace Content.Shared.Atmos.Prototypes
{
[Prototype("gas")]
public sealed class GasPrototype : IPrototype
public sealed partial class GasPrototype : IPrototype
{
[DataField("name")] public string Name { get; set; } = "";

Expand Down
2 changes: 1 addition & 1 deletion Content.Shared/Audio/AmbientMusicPrototype.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ namespace Content.Shared.Audio;
/// Attaches a rules prototype to sound files to play ambience.
/// </summary>
[Prototype("ambientMusic")]
public sealed class AmbientMusicPrototype : IPrototype
public sealed partial class AmbientMusicPrototype : IPrototype
{
[IdDataField] public string ID { get; } = string.Empty;

Expand Down
2 changes: 1 addition & 1 deletion Content.Shared/BarSign/BarSignPrototype.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace Content.Shared.BarSign
{
[Prototype("barSign")]
public sealed class BarSignPrototype : IPrototype
public sealed partial class BarSignPrototype : IPrototype
{
[ViewVariables]
[IdDataField]
Expand Down
2 changes: 1 addition & 1 deletion Content.Shared/Body/Prototypes/BodyPrototype.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace Content.Shared.Body.Prototypes;

[Prototype("body")]
public sealed class BodyPrototype : IPrototype
public sealed partial class BodyPrototype : IPrototype
{
[IdDataField] public string ID { get; } = default!;

Expand Down
2 changes: 1 addition & 1 deletion Content.Shared/Body/Prototypes/MetabolismGroupPrototype.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace Content.Shared.Body.Prototypes
{
[Prototype("metabolismGroup")]
public sealed class MetabolismGroupPrototype : IPrototype
public sealed partial class MetabolismGroupPrototype : IPrototype
{
[IdDataField]
public string ID { get; private set; } = default!;
Expand Down
2 changes: 1 addition & 1 deletion Content.Shared/Body/Prototypes/MetabolizerTypePrototype.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace Content.Shared.Body.Prototypes
{
[Prototype("metabolizerType")]
public sealed class MetabolizerTypePrototype : IPrototype
public sealed partial class MetabolizerTypePrototype : IPrototype
{
[IdDataField]
public string ID { get; private set; } = default!;
Expand Down
2 changes: 1 addition & 1 deletion Content.Shared/Cargo/Prototypes/CargoBountyPrototype.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace Content.Shared.Cargo.Prototypes;
/// to receive a monetary reward.
/// </summary>
[Prototype("cargoBounty"), Serializable, NetSerializable]
public sealed class CargoBountyPrototype : IPrototype
public sealed partial class CargoBountyPrototype : IPrototype
{
/// <inheritdoc/>
[IdDataField]
Expand Down
3 changes: 1 addition & 2 deletions Content.Shared/Cargo/Prototypes/CargoProductPrototype.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
using Robust.Shared.Utility;

namespace Content.Shared.Cargo.Prototypes
{
[Prototype("cargoProduct")]
public sealed class CargoProductPrototype : IPrototype
public sealed partial class CargoProductPrototype : IPrototype
{
[DataField("name")] private string _name = string.Empty;

Expand Down
6 changes: 3 additions & 3 deletions Content.Shared/Chat/Prototypes/AutoEmotePrototype.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
namespace Content.Shared.Chat.Prototypes;

using Robust.Shared.Prototypes;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;

namespace Content.Shared.Chat.Prototypes;

[Prototype("autoEmote")]
public sealed class AutoEmotePrototype : IPrototype
public sealed partial class AutoEmotePrototype : IPrototype
{
/// <inheritdoc/>
[IdDataField]
Expand Down
2 changes: 1 addition & 1 deletion Content.Shared/Chat/Prototypes/EmotePrototype.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace Content.Shared.Chat.Prototypes;
/// Entities can activate emotes by chat input or code.
/// </summary>
[Prototype("emote")]
public sealed class EmotePrototype : IPrototype
public sealed partial class EmotePrototype : IPrototype
{
[IdDataField]
public string ID { get; private set; } = default!;
Expand Down
2 changes: 1 addition & 1 deletion Content.Shared/Chat/Prototypes/EmoteSoundsPrototype.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ namespace Content.Shared.Chat.Prototypes;
/// Different entities may use different sounds collections.
/// </summary>
[Prototype("emoteSounds")]
public sealed class EmoteSoundsPrototype : IPrototype
public sealed partial class EmoteSoundsPrototype : IPrototype
{
[IdDataField]
public string ID { get; private set; } = default!;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace Content.Shared.Chat.TypingIndicator;
/// Prototype to store chat typing indicator visuals.
/// </summary>
[Prototype("typingIndicator")]
public sealed class TypingIndicatorPrototype : IPrototype
public sealed partial class TypingIndicatorPrototype : IPrototype
{
[IdDataField]
public string ID { get; private set; } = default!;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ namespace Content.Shared.Chemistry.Dispenser
/// machines define their inventory.
/// </summary>
[Serializable, NetSerializable, Prototype("reagentDispenserInventory")]
public sealed class ReagentDispenserInventoryPrototype : IPrototype
public sealed partial class ReagentDispenserInventoryPrototype : IPrototype
{
// TODO use ReagentId
[DataField("inventory", customTypeSerializer: typeof(PrototypeIdListSerializer<ReagentPrototype>))]
Expand Down
2 changes: 1 addition & 1 deletion Content.Shared/Chemistry/Reaction/ReactionPrototype.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ namespace Content.Shared.Chemistry.Reaction
/// Prototype for chemical reaction definitions
/// </summary>
[Prototype("reaction")]
public sealed class ReactionPrototype : IPrototype, IComparable<ReactionPrototype>
public sealed partial class ReactionPrototype : IPrototype, IComparable<ReactionPrototype>
{
[ViewVariables]
[IdDataField]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace Content.Shared.Chemistry.Reaction;

[Prototype("reactiveGroup")]
public sealed class ReactiveGroupPrototype : IPrototype
public sealed partial class ReactiveGroupPrototype : IPrototype
{
[IdDataField]
public string ID { get; private set; } = default!;
Expand Down
2 changes: 1 addition & 1 deletion Content.Shared/Communications/CommsHackerComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public sealed partial class CommsHackerComponent : Component
/// You wouldn't do that, right?
/// </summary>
[Prototype("ninjaHackingThreat")]
public sealed class NinjaHackingThreatPrototype : IPrototype
public sealed partial class NinjaHackingThreatPrototype : IPrototype
{
[IdDataField]
public string ID { get; private set; } = default!;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
namespace Content.Shared.Construction.Prototypes
{
[Prototype("constructionGraph")]
public sealed class ConstructionGraphPrototype : IPrototype, ISerializationHooks
public sealed partial class ConstructionGraphPrototype : IPrototype, ISerializationHooks
{
private readonly Dictionary<string, ConstructionGraphNode> _nodes = new();
private readonly Dictionary<(string, string), ConstructionGraphNode[]?> _paths = new();
Expand Down
Loading

0 comments on commit 2d58d19

Please sign in to comment.