]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Replace usages of customTypeSerializer PrototypeIdListSerializer with something that...
authorDrSmugleaf <10968691+DrSmugleaf@users.noreply.github.com>
Thu, 10 Jul 2025 03:06:51 +0000 (20:06 -0700)
committerGitHub <noreply@github.com>
Thu, 10 Jul 2025 03:06:51 +0000 (05:06 +0200)
* Replace usages of customTypeSerializer PrototypeIdListSerializer with something that doesn't take 20 separate words to type out

* Missed one

* Missed another

* Fix data field ids

39 files changed:
Content.Client/SurveillanceCamera/UI/SurveillanceCameraSetupWindow.xaml.cs
Content.Server/Arcade/SpaceVillainGame/SpaceVillainArcadeComponent.cs
Content.Server/Botany/SeedPrototype.cs
Content.Server/EntityList/SpawnEntityListCommand.cs
Content.Server/GameTicking/Presets/GamePresetPrototype.cs
Content.Server/Implants/Components/AutoImplantComponent.cs
Content.Server/Jobs/AddImplantSpecial.cs
Content.Server/Research/Systems/ResearchSystem.Technology.cs
Content.Server/Silicons/Borgs/BorgSystem.Modules.cs
Content.Server/StationEvents/Components/SolarFlareRuleComponent.cs
Content.Server/StationEvents/Components/VentClogRuleComponent.cs
Content.Server/StationEvents/Events/VentClogRule.cs
Content.Server/SurveillanceCamera/Components/SurveillanceCameraComponent.cs
Content.Server/SurveillanceCamera/Components/SurveillanceCameraRouterComponent.cs
Content.Server/Worldgen/Components/BiomeSelectionComponent.cs
Content.Server/Worldgen/Components/Debris/BlobFloorPlanBuilderComponent.cs
Content.Shared/Chemistry/Components/Solution.cs
Content.Shared/Chemistry/EntitySystems/SharedSolutionContainerSystem.cs
Content.Shared/Damage/Prototypes/DamageContainerPrototype.cs
Content.Shared/Damage/Prototypes/DamageGroupPrototype.cs
Content.Shared/EntityList/EntityListPrototype.cs
Content.Shared/Implants/SharedSubdermalImplantSystem.cs
Content.Shared/Parallax/Biomes/Layers/BiomeDecalLayer.cs
Content.Shared/Parallax/Biomes/Layers/BiomeEntityLayer.cs
Content.Shared/Parallax/Biomes/Layers/IBiomeWorldLayer.cs
Content.Shared/Random/RandomFillSolution.cs
Content.Shared/Research/Components/TechnologyDatabaseComponent.cs
Content.Shared/Salvage/Expeditions/Modifiers/IBiomeSpecificMod.cs
Content.Shared/Salvage/Expeditions/Modifiers/SalvageAirMod.cs
Content.Shared/Salvage/Expeditions/Modifiers/SalvageDungeonModPrototype.cs
Content.Shared/Salvage/Expeditions/Modifiers/SalvageLightMod.cs
Content.Shared/Salvage/Expeditions/Modifiers/SalvageTemperatureMod.cs
Content.Shared/Salvage/Expeditions/Modifiers/SalvageWeatherMod.cs
Content.Shared/Silicons/Borgs/Components/ItemBorgModuleComponent.cs
Content.Shared/Silicons/Laws/SiliconLawsetPrototype.cs
Content.Shared/Singularity/Components/SharedEmitterComponent.cs
Content.Shared/SurveillanceCamera/SharedSurveillanceCameraMonitorSystem.cs
Content.Shared/Tiles/FloorTileComponent.cs
Content.Shared/Tiles/FloorTileSystem.cs

index a7feb9db549eed0f9576b662a68c8ca4ee88835e..1c8568b2bdc7c3d78c81b19a07873ed4ab1186c3 100644 (file)
@@ -38,7 +38,7 @@ public sealed partial class SurveillanceCameraSetupWindow : DefaultWindow
     }
 
     // Pass in a list of frequency prototype IDs.
-    public void LoadAvailableNetworks(uint currentNetwork, List<string> networks)
+    public void LoadAvailableNetworks(uint currentNetwork, List<ProtoId<DeviceFrequencyPrototype>> networks)
     {
         NetworkSelector.Clear();
 
index e93fcc6e8f1957efdd8430391530646938720487..3c8a4de2df8fe4459c825ade696134ec8ec94e4c 100644 (file)
@@ -1,7 +1,6 @@
 using Content.Shared.Arcade;
 using Robust.Shared.Audio;
 using Robust.Shared.Prototypes;
-using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.List;
 
 namespace Content.Server.Arcade.SpaceVillain;
 
@@ -90,8 +89,8 @@ public sealed partial class SpaceVillainArcadeComponent : SharedSpaceVillainArca
     /// The prototypes that can be dispensed as a reward for winning the game.
     /// </summary>
     [ViewVariables(VVAccess.ReadWrite)]
-    [DataField("possibleRewards", customTypeSerializer: typeof(PrototypeIdListSerializer<EntityPrototype>))]
-    public List<string> PossibleRewards = new();
+    [DataField]
+    public List<EntProtoId> PossibleRewards = new();
 
     /// <summary>
     /// The minimum number of prizes the arcade machine can have.
index ae182cbe7e8862357c940132d0de09ad8fcd151b..ee7ca4f584616b8fb0ce000504e767981336698d 100644 (file)
@@ -1,17 +1,14 @@
 using Content.Server.Botany.Components;
 using Content.Server.Botany.Systems;
+using Content.Server.EntityEffects;
 using Content.Shared.Atmos;
 using Content.Shared.Database;
-using Content.Shared.EntityEffects;
 using Content.Shared.Random;
 using Robust.Shared.Audio;
 using Robust.Shared.Prototypes;
 using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
-using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.List;
 using Robust.Shared.Utility;
 
-using Content.Server.EntityEffects;
-
 namespace Content.Server.Botany;
 
 [Prototype]
@@ -133,8 +130,8 @@ public partial class SeedData
     /// <summary>
     ///     The entity prototype this seed spawns when it gets harvested.
     /// </summary>
-    [DataField("productPrototypes", customTypeSerializer: typeof(PrototypeIdListSerializer<EntityPrototype>))]
-    public List<string> ProductPrototypes = new();
+    [DataField]
+    public List<EntProtoId> ProductPrototypes = new();
 
     [DataField] public Dictionary<string, SeedChemQuantity> Chemicals = new();
 
@@ -243,8 +240,8 @@ public partial class SeedData
     /// <summary>
     ///     The seed prototypes this seed may mutate into when prompted to.
     /// </summary>
-    [DataField(customTypeSerializer: typeof(PrototypeIdListSerializer<SeedPrototype>))]
-    public List<string> MutationPrototypes = new();
+    [DataField]
+    public List<ProtoId<SeedPrototype>> MutationPrototypes = new();
 
     /// <summary>
     ///  Log impact for when the seed is planted.
@@ -270,8 +267,8 @@ public partial class SeedData
             Mysterious = Mysterious,
 
             PacketPrototype = PacketPrototype,
-            ProductPrototypes = new List<string>(ProductPrototypes),
-            MutationPrototypes = new List<string>(MutationPrototypes),
+            ProductPrototypes = new List<EntProtoId>(ProductPrototypes),
+            MutationPrototypes = new List<ProtoId<SeedPrototype>>(MutationPrototypes),
             Chemicals = new Dictionary<string, SeedChemQuantity>(Chemicals),
             ConsumeGasses = new Dictionary<Gas, float>(ConsumeGasses),
             ExudeGasses = new Dictionary<Gas, float>(ExudeGasses),
@@ -330,8 +327,8 @@ public partial class SeedData
             Mysterious = other.Mysterious,
 
             PacketPrototype = other.PacketPrototype,
-            ProductPrototypes = new List<string>(other.ProductPrototypes),
-            MutationPrototypes = new List<string>(other.MutationPrototypes),
+            ProductPrototypes = new List<EntProtoId>(other.ProductPrototypes),
+            MutationPrototypes = new List<ProtoId<SeedPrototype>>(other.MutationPrototypes),
 
             Chemicals = new Dictionary<string, SeedChemQuantity>(Chemicals),
             ConsumeGasses = new Dictionary<Gas, float>(ConsumeGasses),
index 07bc26996e92736095cd5a20292f950bcd6606c6..f70b0ccb070290ad6ed1c978db34fe04eeb6471b 100644 (file)
@@ -43,7 +43,7 @@ namespace Content.Server.EntityList
 
             var i = 0;
 
-            foreach (var entity in prototype.Entities(_prototypeManager))
+            foreach (var entity in prototype.GetEntities(_prototypeManager))
             {
                 EntityManager.SpawnEntity(entity.ID, EntityManager.GetComponent<TransformComponent>(attached).Coordinates);
                 i++;
index 87be9626027ddf6d413a0a720ab28c1549327fa8..a40ac4d78a8301c62775f894db4d452c9f3a5d78 100644 (file)
@@ -1,8 +1,6 @@
-
 using Content.Server.Maps;
 using Robust.Shared.Prototypes;
 using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
-using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.List;
 
 namespace Content.Server.GameTicking.Presets
 {
@@ -33,8 +31,8 @@ namespace Content.Server.GameTicking.Presets
         [DataField("maxPlayers")]
         public int? MaxPlayers;
 
-        [DataField("rules", customTypeSerializer: typeof(PrototypeIdListSerializer<EntityPrototype>))]
-        public IReadOnlyList<string> Rules { get; private set; } = Array.Empty<string>();
+        [DataField]
+        public IReadOnlyList<EntProtoId> Rules { get; private set; } = Array.Empty<EntProtoId>();
 
         /// <summary>
         /// If specified, the gamemode will only be run with these maps.
index e082354d8b42b0bd1f1c94eb186d195bdf3d70a5..48cfabf58f5711426f3149da806b917109daa617 100644 (file)
@@ -1,5 +1,4 @@
 using Robust.Shared.Prototypes;
-using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.List;
 
 namespace Content.Server.Implants.Components;
 
@@ -12,6 +11,6 @@ public sealed partial class AutoImplantComponent : Component
     /// <summary>
     /// List of implants to inject.
     /// </summary>
-    [DataField("implants", required: true, customTypeSerializer: typeof(PrototypeIdListSerializer<EntityPrototype>))]
-    public List<string> Implants = new();
+    [DataField(required: true)]
+    public List<EntProtoId> Implants = new();
 }
index 83193e7056c5b6964ae173dc80da476002d2bc7a..3967a08d9ee880559cc84b71094f3ba83a351310 100644 (file)
@@ -2,7 +2,6 @@
 using Content.Shared.Roles;
 using JetBrains.Annotations;
 using Robust.Shared.Prototypes;
-using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.Set;
 
 namespace Content.Server.Jobs;
 
@@ -12,8 +11,8 @@ namespace Content.Server.Jobs;
 [UsedImplicitly]
 public sealed partial class AddImplantSpecial : JobSpecial
 {
-    [DataField("implants", customTypeSerializer: typeof(PrototypeIdHashSetSerializer<EntityPrototype>))]
-    public HashSet<String> Implants { get; private set; } = new();
+    [DataField]
+    public HashSet<EntProtoId> Implants { get; private set; } = new();
 
     public override void AfterEquip(EntityUid mob)
     {
index 0237c8712a31713a762ca53c7e69d0045bdf5922..3e8888276fc0e9e85aeb0154e61f09ecc072e7c8 100644 (file)
@@ -2,6 +2,7 @@ using Content.Shared.Database;
 using Content.Shared.Research.Components;
 using Content.Shared.Research.Prototypes;
 using JetBrains.Annotations;
+using Robust.Shared.Prototypes;
 
 namespace Content.Server.Research.Systems;
 
@@ -165,9 +166,9 @@ public sealed partial class ResearchSystem
             return;
         component.MainDiscipline = null;
         component.CurrentTechnologyCards = new List<string>();
-        component.SupportedDisciplines = new List<string>();
-        component.UnlockedTechnologies = new List<string>();
-        component.UnlockedRecipes = new List<string>();
+        component.SupportedDisciplines = new List<ProtoId<TechDisciplinePrototype>>();
+        component.UnlockedTechnologies = new List<ProtoId<TechnologyPrototype>>();
+        component.UnlockedRecipes = new List<ProtoId<LatheRecipePrototype>>();
         Dirty(uid, component);
     }
 }
index 1b6040773c48c316a23cc87837af55974599563a..07fb1cb30b1ad31caaaefbb03680ff5b34b56020 100644 (file)
@@ -199,7 +199,7 @@ public sealed partial class BorgSystem
             else
             {
                 item = component.ProvidedContainer.ContainedEntities
-                    .FirstOrDefault(ent => Prototype(ent)?.ID == itemProto);
+                    .FirstOrDefault(ent => Prototype(ent)?.ID == itemProto.Id);
                 if (!item.IsValid())
                 {
                     Log.Debug($"no items found: {component.ProvidedContainer.ContainedEntities.Count}");
index 577d7777d7761bebfb02f19115119cd37d44c891..a47c1925e20502ccb08885cae24a14bb7da017ee 100644 (file)
@@ -1,6 +1,6 @@
 using Content.Server.StationEvents.Events;
 using Content.Shared.Radio;
-using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.List;
+using Robust.Shared.Prototypes;
 using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.Set;
 
 namespace Content.Server.StationEvents.Components;
@@ -29,8 +29,8 @@ public sealed partial class SolarFlareRuleComponent : Component
     /// <remarks>
     ///     Channels are not removed from this, so its possible to roll the same channel multiple times.
     /// </remarks>
-    [DataField("extraChannels", customTypeSerializer: typeof(PrototypeIdListSerializer<RadioChannelPrototype>))]
-    public List<String> ExtraChannels = new();
+    [DataField]
+    public List<ProtoId<RadioChannelPrototype>> ExtraChannels = new();
 
     /// <summary>
     ///     Number of times to roll a channel from ExtraChannels.
index afb3a363265268ee8f589070f3b7cf7719ba44d4..d51c48b4aeb42f513d29a782a968abf4c7c9e870 100644 (file)
@@ -1,7 +1,7 @@
 using Content.Server.StationEvents.Events;
 using Content.Shared.Chemistry.Reagent;
 using Robust.Shared.Audio;
-using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.List;
+using Robust.Shared.Prototypes;
 
 namespace Content.Server.StationEvents.Components;
 
@@ -12,8 +12,8 @@ public sealed partial class VentClogRuleComponent : Component
     /// Somewhat safe chemicals to put in foam that probably won't instantly kill you.
     /// There is a small chance of using any reagent, ignoring this.
     /// </summary>
-    [DataField(customTypeSerializer: typeof(PrototypeIdListSerializer<ReagentPrototype>))]
-    public IReadOnlyList<string> SafeishVentChemicals = new[]
+    [DataField]
+    public IReadOnlyList<ProtoId<ReagentPrototype>> SafeishVentChemicals = new ProtoId<ReagentPrototype>[]
     {
         "Water", "Blood", "Slime", "SpaceDrugs", "SpaceCleaner", "Nutriment", "Sugar", "SpaceLube", "Ephedrine", "Ale", "Beer", "SpaceGlue"
     };
@@ -45,8 +45,8 @@ public sealed partial class VentClogRuleComponent : Component
     /// <summary>
     /// Reagents that gets the weak numbers used instead of regular ones.
     /// </summary>
-    [DataField(customTypeSerializer: typeof(PrototypeIdListSerializer<ReagentPrototype>))]
-    public IReadOnlyList<string> WeakReagents = new[]
+    [DataField]
+    public IReadOnlyList<ProtoId<ReagentPrototype>> WeakReagents = new ProtoId<ReagentPrototype>[]
     {
         "SpaceLube", "SpaceGlue"
     };
index ad8e4b5a42cceb9a77884aabf838e624d4900ac5..d93c67ef92dc8afdc0451872c68ba810ccb956d6 100644 (file)
@@ -1,14 +1,15 @@
+using System.Linq;
 using Content.Server.Atmos.Piping.Unary.Components;
 using Content.Server.Fluids.EntitySystems;
 using Content.Server.StationEvents.Components;
 using Content.Shared.Chemistry.Components;
+using Content.Shared.Chemistry.Reaction;
 using Content.Shared.Chemistry.Reagent;
 using Content.Shared.GameTicking.Components;
 using Content.Shared.Station.Components;
 using JetBrains.Annotations;
+using Robust.Shared.Prototypes;
 using Robust.Shared.Random;
-using System.Linq;
-using Content.Shared.Chemistry.Reaction;
 
 namespace Content.Server.StationEvents.Events;
 
@@ -27,7 +28,7 @@ public sealed class VentClogRule : StationEventSystem<VentClogRuleComponent>
         // TODO: "safe random" for chems. Right now this includes admin chemicals.
         var allReagents = PrototypeManager.EnumeratePrototypes<ReagentPrototype>()
             .Where(x => !x.Abstract)
-            .Select(x => x.ID).ToList();
+            .Select(x => new ProtoId<ReagentPrototype>(x.ID)).ToList();
 
         foreach (var (_, transform) in EntityQuery<GasVentPumpComponent, TransformComponent>())
         {
index 8473462f80c307bcd54b37af9d1a915aa2fc8c90..b0d41e52c742e61355435fe6e0e1b1d021c401ab 100644 (file)
@@ -1,5 +1,5 @@
 using Content.Shared.DeviceNetwork;
-using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.List;
+using Robust.Shared.Prototypes;
 
 namespace Content.Server.SurveillanceCamera;
 
@@ -43,6 +43,6 @@ public sealed partial class SurveillanceCameraComponent : Component
     public bool NetworkSet { get; set; }
 
     // This has to be device network frequency prototypes.
-    [DataField("setupAvailableNetworks", customTypeSerializer:typeof(PrototypeIdListSerializer<DeviceFrequencyPrototype>))]
-    public List<string> AvailableNetworks { get; private set; } = new();
+    [DataField("setupAvailableNetworks")]
+    public List<ProtoId<DeviceFrequencyPrototype>> AvailableNetworks { get; private set; } = new();
 }
index d15d5e7d3941ab31be7841ee16e937e85765471a..0967d0b0437a0c7f6d5387201df1850cdb88c3af 100644 (file)
@@ -1,6 +1,6 @@
 using Content.Shared.DeviceNetwork;
+using Robust.Shared.Prototypes;
 using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
-using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.List;
 
 namespace Content.Server.SurveillanceCamera;
 
@@ -26,6 +26,6 @@ public sealed partial class SurveillanceCameraRouterComponent : Component
     [DataField("subnetFrequency", customTypeSerializer:typeof(PrototypeIdSerializer<DeviceFrequencyPrototype>))]
     public string? SubnetFrequencyId { get; set;  }
 
-    [DataField("setupAvailableNetworks", customTypeSerializer:typeof(PrototypeIdListSerializer<DeviceFrequencyPrototype>))]
-    public List<string> AvailableNetworks { get; private set; } = new();
+    [DataField("setupAvailableNetworks")]
+    public List<ProtoId<DeviceFrequencyPrototype>> AvailableNetworks { get; private set; } = new();
 }
index f6b4c82ebb6cd4c35d97bd62e0f8ef436cc5b332..08571cd588c533d7992335265a00240943c20855 100644 (file)
@@ -1,6 +1,6 @@
-using Content.Server.Worldgen.Systems.Biomes;
-using Content.Server.Worldgen.Prototypes;
-using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.List;
+using Content.Server.Worldgen.Prototypes;
+using Content.Server.Worldgen.Systems.Biomes;
+using Robust.Shared.Prototypes;
 
 namespace Content.Server.Worldgen.Components;
 
@@ -15,7 +15,7 @@ public sealed partial class BiomeSelectionComponent : Component
     ///     The list of biomes available to this selector.
     /// </summary>
     /// <remarks>This is always sorted by priority after ComponentStartup.</remarks>
-    [DataField("biomes", required: true,
-        customTypeSerializer: typeof(PrototypeIdListSerializer<BiomePrototype>))] public List<string> Biomes = new();
+    [DataField(required: true)]
+    public List<ProtoId<BiomePrototype>> Biomes = new();
 }
 
index 6d1fa5d9570631f0beca95fc9ddd1cf47b18025e..a1317ae2edfca5f0aadaed1235915a9abda8b896 100644 (file)
@@ -1,6 +1,6 @@
 using Content.Server.Worldgen.Systems.Debris;
 using Content.Shared.Maps;
-using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.List;
+using Robust.Shared.Prototypes;
 
 namespace Content.Server.Worldgen.Components.Debris;
 
@@ -24,9 +24,8 @@ public sealed partial class BlobFloorPlanBuilderComponent : Component
     /// <summary>
     ///     The tiles to be used for the floor plan.
     /// </summary>
-    [DataField("floorTileset", required: true,
-        customTypeSerializer: typeof(PrototypeIdListSerializer<ContentTileDefinition>))]
-    public List<string> FloorTileset { get; private set;  } = default!;
+    [DataField(required: true)]
+    public List<ProtoId<ContentTileDefinition>> FloorTileset { get; private set;  } = default!;
 
     /// <summary>
     ///     The number of floor tiles to place when drawing the asteroid layout.
index 9622ccae305e60aa434d1185e7fc049f22ee0f34..38be03226d34b14f5c3038ad0131d322d8a57b57 100644 (file)
@@ -1,12 +1,12 @@
+using System.Collections;
+using System.Linq;
+using Content.Shared.Chemistry.Components.SolutionManager;
 using Content.Shared.Chemistry.Reagent;
 using Content.Shared.FixedPoint;
 using JetBrains.Annotations;
 using Robust.Shared.Prototypes;
 using Robust.Shared.Serialization;
 using Robust.Shared.Utility;
-using System.Collections;
-using System.Linq;
-using Content.Shared.Chemistry.Components.SolutionManager;
 
 namespace Content.Shared.Chemistry.Components
 {
@@ -583,6 +583,7 @@ namespace Content.Shared.Chemistry.Components
         /// <summary>
         /// Splits a solution without the specified reagent prototypes.
         /// </summary>
+        [Obsolete("Use SplitSolutionWithout with params ProtoId<ReagentPrototype>")]
         public Solution SplitSolutionWithout(FixedPoint2 toTake, params string[] excludedPrototypes)
         {
             // First remove the blacklisted prototypes
@@ -612,6 +613,38 @@ namespace Content.Shared.Chemistry.Components
             return sol;
         }
 
+        /// <summary>
+        /// Splits a solution without the specified reagent prototypes.
+        /// </summary>
+        public Solution SplitSolutionWithout(FixedPoint2 toTake, params ProtoId<ReagentPrototype>[] excludedPrototypes)
+        {
+            // First remove the blacklisted prototypes
+            List<ReagentQuantity> excluded = new();
+            foreach (var id in excludedPrototypes)
+            {
+                foreach (var tuple in Contents)
+                {
+                    if (tuple.Reagent.Prototype != id)
+                        continue;
+
+                    excluded.Add(tuple);
+                    RemoveReagent(tuple);
+                    break;
+                }
+            }
+
+            // Then split the solution
+            var sol = SplitSolution(toTake);
+
+            // Then re-add the excluded reagents to the original solution.
+            foreach (var reagent in excluded)
+            {
+                AddReagent(reagent);
+            }
+
+            return sol;
+        }
+
         /// <summary>
         /// Splits a solution with only the specified reagent prototypes.
         /// </summary>
index fe4d1025362f100aa496b7cba73c0e1ef7ad48d5..83de0970ec4aeeb6ab47b4158a02dcd30c86c837 100644 (file)
@@ -1,24 +1,24 @@
+using System.Diagnostics.CodeAnalysis;
+using System.Linq;
+using System.Numerics;
+using System.Runtime.CompilerServices;
+using System.Text;
 using Content.Shared.Chemistry.Components;
 using Content.Shared.Chemistry.Components.SolutionManager;
 using Content.Shared.Chemistry.Reaction;
 using Content.Shared.Chemistry.Reagent;
+using Content.Shared.Containers;
 using Content.Shared.Examine;
 using Content.Shared.FixedPoint;
+using Content.Shared.Hands.Components;
+using Content.Shared.Hands.EntitySystems;
 using Content.Shared.Verbs;
 using JetBrains.Annotations;
 using Robust.Shared.Containers;
-using Robust.Shared.Prototypes;
-using Robust.Shared.Utility;
-using System.Diagnostics.CodeAnalysis;
-using System.Linq;
-using System.Numerics;
-using System.Runtime.CompilerServices;
-using System.Text;
-using Content.Shared.Containers;
-using Content.Shared.Hands.Components;
-using Content.Shared.Hands.EntitySystems;
 using Robust.Shared.Map;
 using Robust.Shared.Network;
+using Robust.Shared.Prototypes;
+using Robust.Shared.Utility;
 using Dependency = Robust.Shared.IoC.DependencyAttribute;
 
 namespace Content.Shared.Chemistry.EntitySystems;
@@ -61,14 +61,14 @@ public partial record struct SolutionAccessAttemptEvent(string SolutionName)
 [UsedImplicitly]
 public abstract partial class SharedSolutionContainerSystem : EntitySystem
 {
-    [Dependency] protected readonly IPrototypeManager PrototypeManager = default!;
-    [Dependency] protected readonly ChemicalReactionSystem ChemicalReactionSystem = default!;
-    [Dependency] protected readonly ExamineSystemShared ExamineSystem = default!;
-    [Dependency] protected readonly SharedAppearanceSystem AppearanceSystem = default!;
-    [Dependency] protected readonly SharedHandsSystem Hands = default!;
-    [Dependency] protected readonly SharedContainerSystem ContainerSystem = default!;
-    [Dependency] protected readonly MetaDataSystem MetaDataSys = default!;
-    [Dependency] protected readonly INetManager NetManager = default!;
+    [Robust.Shared.IoC.Dependency] protected readonly IPrototypeManager PrototypeManager = default!;
+    [Robust.Shared.IoC.Dependency] protected readonly ChemicalReactionSystem ChemicalReactionSystem = default!;
+    [Robust.Shared.IoC.Dependency] protected readonly ExamineSystemShared ExamineSystem = default!;
+    [Robust.Shared.IoC.Dependency] protected readonly SharedAppearanceSystem AppearanceSystem = default!;
+    [Robust.Shared.IoC.Dependency] protected readonly SharedHandsSystem Hands = default!;
+    [Robust.Shared.IoC.Dependency] protected readonly SharedContainerSystem ContainerSystem = default!;
+    [Robust.Shared.IoC.Dependency] protected readonly MetaDataSystem MetaDataSys = default!;
+    [Robust.Shared.IoC.Dependency] protected readonly INetManager NetManager = default!;
 
     public override void Initialize()
     {
@@ -376,6 +376,7 @@ public abstract partial class SharedSolutionContainerSystem : EntitySystem
     /// <summary>
     /// Splits a solution without the specified reagent(s).
     /// </summary>
+    [Obsolete("Use SplitSolutionWithout with params ProtoId<ReagentPrototype>")]
     public Solution SplitSolutionWithout(Entity<SolutionComponent> soln, FixedPoint2 quantity, params string[] reagents)
     {
         var (uid, comp) = soln;
@@ -386,6 +387,19 @@ public abstract partial class SharedSolutionContainerSystem : EntitySystem
         return splitSol;
     }
 
+    /// <summary>
+    /// Splits a solution without the specified reagent(s).
+    /// </summary>
+    public Solution SplitSolutionWithout(Entity<SolutionComponent> soln, FixedPoint2 quantity, params ProtoId<ReagentPrototype>[] reagents)
+    {
+        var (uid, comp) = soln;
+        var solution = comp.Solution;
+
+        var splitSol = solution.SplitSolutionWithout(quantity, reagents);
+        UpdateChemicals(soln);
+        return splitSol;
+    }
+
     public void RemoveAllSolution(Entity<SolutionComponent> soln)
     {
         var (uid, comp) = soln;
index 95de0fb29d02a242a3fb7de4929f2c36fa03bc6b..00322f0884a696c864e08fcadc521121bef3f0b9 100644 (file)
@@ -1,6 +1,5 @@
 using Robust.Shared.Prototypes;
 using Robust.Shared.Serialization;
-using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.List;
 
 namespace Content.Shared.Damage.Prototypes
 {
@@ -22,14 +21,14 @@ namespace Content.Shared.Damage.Prototypes
         /// <summary>
         ///     List of damage groups that are supported by this container.
         /// </summary>
-        [DataField("supportedGroups", customTypeSerializer: typeof(PrototypeIdListSerializer<DamageGroupPrototype>))]
-        public List<string> SupportedGroups = new();
+        [DataField]
+        public List<ProtoId<DamageGroupPrototype>> SupportedGroups = new();
 
         /// <summary>
         ///     Partial List of damage types supported by this container. Note that members of the damage groups listed
         ///     in <see cref="SupportedGroups"/> are also supported, but they are not included in this list.
         /// </summary>
-        [DataField("supportedTypes", customTypeSerializer: typeof(PrototypeIdListSerializer<DamageTypePrototype>))]
-        public List<string> SupportedTypes = new();
+        [DataField]
+        public List<ProtoId<DamageTypePrototype>> SupportedTypes = new();
     }
 }
index 7615724467224c0710982e2edac3a7c808b98231..a33064f934e5d391e5f53c28e63ba3bbdbd0bf6f 100644 (file)
@@ -1,6 +1,5 @@
 using Robust.Shared.Prototypes;
 using Robust.Shared.Serialization;
-using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.List;
 
 namespace Content.Shared.Damage.Prototypes
 {
@@ -22,7 +21,7 @@ namespace Content.Shared.Damage.Prototypes
         [ViewVariables(VVAccess.ReadOnly)]
         public string LocalizedName => Loc.GetString(Name);
 
-        [DataField("damageTypes", required: true, customTypeSerializer: typeof(PrototypeIdListSerializer<DamageTypePrototype>))]
-        public List<string> DamageTypes { get; private set; } = default!;
+        [DataField(required: true)]
+        public List<ProtoId<DamageTypePrototype>> DamageTypes { get; private set; } = default!;
     }
 }
index 0248e2100c6188cb0feb0a946bb54192ccbad527..76646d00f75ccc2a37a86c92d531dc8e45b97eb5 100644 (file)
@@ -1,6 +1,5 @@
 using System.Collections.Immutable;
 using Robust.Shared.Prototypes;
-using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.List;
 
 namespace Content.Shared.EntityList
 {
@@ -11,14 +10,14 @@ namespace Content.Shared.EntityList
         [IdDataField]
         public string ID { get; private set; } = default!;
 
-        [DataField("entities", customTypeSerializer: typeof(PrototypeIdListSerializer<EntityPrototype>))]
-        public ImmutableList<string> EntityIds { get; private set; } = ImmutableList<string>.Empty;
+        [DataField]
+        public ImmutableList<EntProtoId> Entities { get; private set; } = ImmutableList<EntProtoId>.Empty;
 
-        public IEnumerable<EntityPrototype> Entities(IPrototypeManager? prototypeManager = null)
+        public IEnumerable<EntityPrototype> GetEntities(IPrototypeManager? prototypeManager = null)
         {
             prototypeManager ??= IoCManager.Resolve<IPrototypeManager>();
 
-            foreach (var entityId in EntityIds)
+            foreach (var entityId in Entities)
             {
                 yield return prototypeManager.Index<EntityPrototype>(entityId);
             }
index 5bbd285a99acd75601cc72fec65597d3f4cdc43a..95c3f8664fbf8cd63c25fab08a332fe6aad466da 100644 (file)
@@ -1,3 +1,4 @@
+using System.Linq;
 using Content.Shared.Actions;
 using Content.Shared.Implants.Components;
 using Content.Shared.Interaction;
@@ -6,9 +7,7 @@ using Content.Shared.Mobs;
 using Content.Shared.Tag;
 using JetBrains.Annotations;
 using Robust.Shared.Containers;
-using Robust.Shared.Network;
 using Robust.Shared.Prototypes;
-using System.Linq;
 
 namespace Content.Shared.Implants;
 
@@ -91,7 +90,7 @@ public abstract class SharedSubdermalImplantSystem : EntitySystem
     /// Add a list of implants to a person.
     /// Logs any implant ids that don't have <see cref="SubdermalImplantComponent"/>.
     /// </summary>
-    public void AddImplants(EntityUid uid, IEnumerable<String> implants)
+    public void AddImplants(EntityUid uid, IEnumerable<EntProtoId> implants)
     {
         foreach (var id in implants)
         {
index 5e31e513a90f2087973991773aaefbbe3eedb81b..f95848e42b03f63c22d8c10490cfdeffd016e983 100644 (file)
@@ -1,8 +1,8 @@
 using Content.Shared.Decals;
 using Content.Shared.Maps;
 using Robust.Shared.Noise;
+using Robust.Shared.Prototypes;
 using Robust.Shared.Serialization;
-using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.List;
 
 namespace Content.Shared.Parallax.Biomes.Layers;
 
@@ -10,8 +10,8 @@ namespace Content.Shared.Parallax.Biomes.Layers;
 public sealed partial class BiomeDecalLayer : IBiomeWorldLayer
 {
     /// <inheritdoc/>
-    [DataField("allowedTiles", customTypeSerializer:typeof(PrototypeIdListSerializer<ContentTileDefinition>))]
-    public List<string> AllowedTiles { get; private set; } = new();
+    [DataField]
+    public List<ProtoId<ContentTileDefinition>> AllowedTiles { get; private set; } = new();
 
     /// <summary>
     /// Divide each tile up by this amount.
@@ -29,6 +29,6 @@ public sealed partial class BiomeDecalLayer : IBiomeWorldLayer
     /// <inheritdoc/>
     [DataField("invert")] public bool Invert { get; private set; } = false;
 
-    [DataField("decals", required: true, customTypeSerializer:typeof(PrototypeIdListSerializer<DecalPrototype>))]
-    public List<string> Decals = new();
+    [DataField(required: true)]
+    public List<ProtoId<DecalPrototype>> Decals = new();
 }
index 21ffdd96e5e62c903acdfdaa8ba633964785a6c5..c09980aaadf5af1094c412df07169fddf32eb0ab 100644 (file)
@@ -2,7 +2,6 @@ using Content.Shared.Maps;
 using Robust.Shared.Noise;
 using Robust.Shared.Prototypes;
 using Robust.Shared.Serialization;
-using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.List;
 
 namespace Content.Shared.Parallax.Biomes.Layers;
 
@@ -10,8 +9,8 @@ namespace Content.Shared.Parallax.Biomes.Layers;
 public sealed partial class BiomeEntityLayer : IBiomeWorldLayer
 {
     /// <inheritdoc/>
-    [DataField("allowedTiles", customTypeSerializer:typeof(PrototypeIdListSerializer<ContentTileDefinition>))]
-    public List<string> AllowedTiles { get; private set; } = new();
+    [DataField]
+    public List<ProtoId<ContentTileDefinition>> AllowedTiles { get; private set; } = new();
 
     [DataField("noise")] public FastNoiseLite Noise { get; private set; } = new(0);
 
@@ -22,6 +21,6 @@ public sealed partial class BiomeEntityLayer : IBiomeWorldLayer
     /// <inheritdoc/>
     [DataField("invert")] public bool Invert { get; private set; } = false;
 
-    [DataField("entities", required: true, customTypeSerializer: typeof(PrototypeIdListSerializer<EntityPrototype>))]
-    public List<string> Entities = new();
+    [DataField(required: true)]
+    public List<EntProtoId> Entities = new();
 }
index e04db913b7be11654866e064c1219705896bfa05..92779b6f8e854c76f1607d1f531e3db9d628785c 100644 (file)
@@ -1,3 +1,6 @@
+using Content.Shared.Maps;
+using Robust.Shared.Prototypes;
+
 namespace Content.Shared.Parallax.Biomes.Layers;
 
 /// <summary>
@@ -8,5 +11,5 @@ public partial interface IBiomeWorldLayer : IBiomeLayer
     /// <summary>
     /// What tiles we're allowed to spawn on, real or biome.
     /// </summary>
-    List<string> AllowedTiles { get; }
+    List<ProtoId<ContentTileDefinition>> AllowedTiles { get; }
 }
index e3b9b7c8622fdd7ba87a70b42009711e08fd3a3a..00453102f3232d9544bc15912e43a972e6b84ba3 100644 (file)
@@ -1,8 +1,7 @@
 using Content.Shared.Chemistry.Reagent;
 using Content.Shared.FixedPoint;
+using Robust.Shared.Prototypes;
 using Robust.Shared.Serialization;
-using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
-using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.List;
 
 namespace Content.Shared.Random;
 
@@ -28,6 +27,6 @@ public sealed partial class RandomFillSolution
     /// <summary>
     ///     Listed reagents that the weight and quantity apply to.
     /// </summary>
-    [DataField("reagents", required: true, customTypeSerializer: typeof(PrototypeIdListSerializer<ReagentPrototype>))]
-    public List<string> Reagents = new();
+    [DataField(required: true)]
+    public List<ProtoId<ReagentPrototype>> Reagents = new();
 }
index a69e4ee9dd709484b01c76e8c4115cb37bff280f..f00338aac7fa4c7261f93cfafa26f6375f2e66cf 100644 (file)
@@ -2,8 +2,8 @@ using Content.Shared.Lathe;
 using Content.Shared.Research.Prototypes;
 using Content.Shared.Research.Systems;
 using Robust.Shared.GameStates;
+using Robust.Shared.Prototypes;
 using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
-using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.List;
 
 namespace Content.Shared.Research.Components;
 
@@ -25,15 +25,15 @@ public sealed partial class TechnologyDatabaseComponent : Component
     /// Which research disciplines are able to be unlocked
     /// </summary>
     [AutoNetworkedField]
-    [DataField("supportedDisciplines", customTypeSerializer: typeof(PrototypeIdListSerializer<TechDisciplinePrototype>))]
-    public List<string> SupportedDisciplines = new();
+    [DataField]
+    public List<ProtoId<TechDisciplinePrototype>> SupportedDisciplines = new();
 
     /// <summary>
     /// The ids of all the technologies which have been unlocked.
     /// </summary>
     [AutoNetworkedField]
-    [DataField("unlockedTechnologies", customTypeSerializer: typeof(PrototypeIdListSerializer<TechnologyPrototype>))]
-    public List<string> UnlockedTechnologies = new();
+    [DataField]
+    public List<ProtoId<TechnologyPrototype>> UnlockedTechnologies = new();
 
     /// <summary>
     /// The ids of all the lathe recipes which have been unlocked.
@@ -41,8 +41,8 @@ public sealed partial class TechnologyDatabaseComponent : Component
     /// </summary>
     /// todo: if you unlock all the recipes in a tech, it doesn't count as unlocking the tech. sadge
     [AutoNetworkedField]
-    [DataField("unlockedRecipes", customTypeSerializer: typeof(PrototypeIdListSerializer<LatheRecipePrototype>))]
-    public List<string> UnlockedRecipes = new();
+    [DataField]
+    public List<ProtoId<LatheRecipePrototype>> UnlockedRecipes = new();
 }
 
 /// <summary>
index f379df9a4c94b55d72062286c37e19db93026a2c..d0c4916265785ac5f65b84ffee3e70708083d93c 100644 (file)
@@ -1,3 +1,5 @@
+using Robust.Shared.Prototypes;
+
 namespace Content.Shared.Salvage.Expeditions.Modifiers;
 
 public interface IBiomeSpecificMod : ISalvageMod
@@ -5,5 +7,5 @@ public interface IBiomeSpecificMod : ISalvageMod
     /// <summary>
     /// Whitelist for biomes. If null then any biome is allowed.
     /// </summary>
-    List<string>? Biomes { get; }
+    List<ProtoId<SalvageBiomeModPrototype>>? Biomes { get; }
 }
index fda08281b0635b16d0da5635c5a02b2ff4202b15..b1a72a3110c3874d19dbff1bd948d473f0671155 100644 (file)
@@ -1,6 +1,5 @@
 using Content.Shared.Atmos;
 using Robust.Shared.Prototypes;
-using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.List;
 
 namespace Content.Shared.Salvage.Expeditions.Modifiers;
 
@@ -24,8 +23,8 @@ public sealed partial class SalvageAirMod : IPrototype, IBiomeSpecificMod
     public float Cost { get; private set; } = 0f;
 
     /// <inheritdoc/>
-    [DataField("biomes", customTypeSerializer: typeof(PrototypeIdListSerializer<SalvageBiomeModPrototype>))]
-    public List<string>? Biomes { get; private set; } = null;
+    [DataField]
+    public List<ProtoId<SalvageBiomeModPrototype>>? Biomes { get; private set; } = null;
 
     /// <summary>
     /// Set to true if this planet will have no atmosphere.
index c8fc22c2afd5af14a086fe142305766b0c994596..69c0e3af88ece304ea03cd795bbc6ab6b98e2999 100644 (file)
@@ -1,7 +1,5 @@
 using Content.Shared.Procedural;
 using Robust.Shared.Prototypes;
-using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
-using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.List;
 
 namespace Content.Shared.Salvage.Expeditions.Modifiers;
 
@@ -17,8 +15,8 @@ public sealed partial class SalvageDungeonModPrototype : IPrototype, IBiomeSpeci
     public float Cost { get; private set; } = 0f;
 
     /// <inheridoc/>
-    [DataField("biomes", customTypeSerializer: typeof(PrototypeIdListSerializer<SalvageBiomeModPrototype>))]
-    public List<string>? Biomes { get; private set; } = null;
+    [DataField]
+    public List<ProtoId<SalvageBiomeModPrototype>>? Biomes { get; private set; } = null;
 
     /// <summary>
     /// The config to use for spawning the dungeon.
index 8acfd8b7c401f35ffa629ceb5a864667ad6fc7f2..9556899353b925ea5eb8ad0ea3b7e5a98647e06e 100644 (file)
@@ -1,5 +1,4 @@
 using Robust.Shared.Prototypes;
-using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.List;
 
 namespace Content.Shared.Salvage.Expeditions.Modifiers;
 
@@ -15,8 +14,8 @@ public sealed partial class SalvageLightMod : IPrototype, IBiomeSpecificMod
     public float Cost { get; private set; } = 0f;
 
     /// <inheritdoc/>
-    [DataField("biomes", customTypeSerializer: typeof(PrototypeIdListSerializer<SalvageBiomeModPrototype>))]
-    public List<string>? Biomes { get; private set; } = null;
+    [DataField]
+    public List<ProtoId<SalvageBiomeModPrototype>>? Biomes { get; private set; } = null;
 
     [DataField("color", required: true)] public Color? Color;
 }
index 8871c14572eca7b3bd5b72a6d8adb0a60487b64f..d48ea7bd3a809db0038e600a3432f86040098149 100644 (file)
@@ -1,5 +1,4 @@
 using Robust.Shared.Prototypes;
-using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.List;
 
 namespace Content.Shared.Salvage.Expeditions.Modifiers;
 
@@ -15,8 +14,8 @@ public sealed partial class SalvageTemperatureMod : IPrototype, IBiomeSpecificMo
     public float Cost { get; private set; } = 0f;
 
     /// <inheritdoc/>
-    [DataField("biomes", customTypeSerializer: typeof(PrototypeIdListSerializer<SalvageBiomeModPrototype>))]
-    public List<string>? Biomes { get; private set; } = null;
+    [DataField]
+    public List<ProtoId<SalvageBiomeModPrototype>>? Biomes { get; private set; } = null;
 
     /// <summary>
     /// Temperature in the planets air mix.
index 1f3b13daee60ae0532fa5aced6256a74b824e465..8bf0614b46db1fde07079dc7c44e88d8ffd3fcea 100644 (file)
@@ -1,7 +1,6 @@
 using Content.Shared.Weather;
 using Robust.Shared.Prototypes;
 using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
-using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.List;
 
 namespace Content.Shared.Salvage.Expeditions.Modifiers;
 
@@ -17,8 +16,8 @@ public sealed partial class SalvageWeatherMod : IPrototype, IBiomeSpecificMod
     public float Cost { get; private set; } = 0f;
 
     /// <inheritdoc/>
-    [DataField("biomes", customTypeSerializer: typeof(PrototypeIdListSerializer<SalvageBiomeModPrototype>))]
-    public List<string>? Biomes { get; private set; } = null;
+    [DataField]
+    public List<ProtoId<SalvageBiomeModPrototype>>? Biomes { get; private set; } = null;
 
     /// <summary>
     /// Weather prototype to use on the planet.
index 75835d0cf01aee032c4ad4617bb0760730584273..e86edb3476998f9866039b541c8721ec37f80b5d 100644 (file)
@@ -1,7 +1,6 @@
 using Robust.Shared.Containers;
 using Robust.Shared.GameStates;
 using Robust.Shared.Prototypes;
-using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.List;
 
 namespace Content.Shared.Silicons.Borgs.Components;
 
@@ -14,8 +13,8 @@ public sealed partial class ItemBorgModuleComponent : Component
     /// <summary>
     /// The items that are provided.
     /// </summary>
-    [DataField("items", customTypeSerializer: typeof(PrototypeIdListSerializer<EntityPrototype>), required: true)]
-    public List<string> Items = new();
+    [DataField(required: true)]
+    public List<EntProtoId> Items = new();
 
     /// <summary>
     /// The entities from <see cref="Items"/> that were spawned.
index a3861504e972ca426f38b6190bfe2dbd4a59fbc2..9f33521d8f16d8245e3c7495c472f981f50dd782 100644 (file)
@@ -1,7 +1,5 @@
-using Content.Shared.FixedPoint;
-using Robust.Shared.Prototypes;
+using Robust.Shared.Prototypes;
 using Robust.Shared.Serialization;
-using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.List;
 
 namespace Content.Shared.Silicons.Laws;
 
@@ -71,8 +69,8 @@ public sealed partial class SiliconLawsetPrototype : IPrototype
     /// <summary>
     /// List of law prototype ids in this lawset.
     /// </summary>
-    [DataField(required: true, customTypeSerializer: typeof(PrototypeIdListSerializer<SiliconLawPrototype>))]
-    public List<string> Laws = new();
+    [DataField(required: true)]
+    public List<ProtoId<SiliconLawPrototype>> Laws = new();
 
     /// <summary>
     /// What entity the lawset considers as a figure of authority.
index c2e7af717b109324b22573e252dcde6179cffc48..dce2f92d0c7d892810182d87be583831ce4ba187 100644 (file)
@@ -4,7 +4,6 @@ using Robust.Shared.GameStates;
 using Robust.Shared.Prototypes;
 using Robust.Shared.Serialization;
 using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
-using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.List;
 using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.Dictionary;
 
 namespace Content.Shared.Singularity.Components;
@@ -31,8 +30,8 @@ public sealed partial class EmitterComponent : Component
     [DataField("boltType", customTypeSerializer: typeof(PrototypeIdSerializer<EntityPrototype>))]
     public string BoltType = "EmitterBolt";
 
-    [DataField("selectableTypes", customTypeSerializer: typeof(PrototypeIdListSerializer<EntityPrototype>))]
-    public List<string> SelectableTypes = new();
+    [DataField]
+    public List<EntProtoId> SelectableTypes = new();
 
     /// <summary>
     /// The current amount of power being used.
index cc6193a09046c39afc5c2da844903e53a6315360..aa03e7aee9493084754b74c9972d822939d935d2 100644 (file)
@@ -1,3 +1,5 @@
+using Content.Shared.DeviceNetwork;
+using Robust.Shared.Prototypes;
 using Robust.Shared.Serialization;
 
 namespace Content.Shared.SurveillanceCamera;
@@ -83,11 +85,11 @@ public sealed class SurveillanceCameraSetupBoundUiState : BoundUserInterfaceStat
 {
     public string Name { get; }
     public uint Network { get; }
-    public List<string> Networks { get; }
+    public List<ProtoId<DeviceFrequencyPrototype>> Networks { get; }
     public bool NameDisabled { get; }
     public bool NetworkDisabled { get; }
 
-    public SurveillanceCameraSetupBoundUiState(string name, uint network, List<string> networks, bool nameDisabled, bool networkDisabled)
+    public SurveillanceCameraSetupBoundUiState(string name, uint network, List<ProtoId<DeviceFrequencyPrototype>> networks, bool nameDisabled, bool networkDisabled)
     {
         Name = name;
         Network = network;
index 92208a76d4083763d8d06f8b3f4dc930116ff5cf..5b9c48ca8b65855cb339209819bc2d0489c463ee 100644 (file)
@@ -1,7 +1,7 @@
 using Content.Shared.Maps;
 using Robust.Shared.Audio;
 using Robust.Shared.GameStates;
-using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.List;
+using Robust.Shared.Prototypes;
 
 namespace Content.Shared.Tiles
 {
@@ -12,8 +12,8 @@ namespace Content.Shared.Tiles
     [RegisterComponent, NetworkedComponent]
     public sealed partial class FloorTileComponent : Component
     {
-        [DataField("outputs", customTypeSerializer: typeof(PrototypeIdListSerializer<ContentTileDefinition>))]
-        public List<string>? OutputTiles;
+        [DataField]
+        public List<ProtoId<ContentTileDefinition>>? Outputs;
 
         [DataField("placeTileSound")] public SoundSpecifier PlaceTileSound =
             new SoundPathSpecifier("/Audio/Items/genhit.ogg")
index 67283eeea0ecd2204ce388f6bf7e8b57b791de2e..298c0390babccb9c90dbd4aec49ac43dc087b0cd 100644 (file)
@@ -2,7 +2,6 @@ using System.Diagnostics.CodeAnalysis;
 using System.Linq;
 using System.Numerics;
 using Content.Shared.Administration.Logs;
-using Content.Shared.Audio;
 using Content.Shared.Database;
 using Content.Shared.Interaction;
 using Content.Shared.Maps;
@@ -17,7 +16,6 @@ using Robust.Shared.Network;
 using Robust.Shared.Physics;
 using Robust.Shared.Physics.Components;
 using Robust.Shared.Physics.Systems;
-using Robust.Shared.Random;
 using Robust.Shared.Timing;
 
 namespace Content.Shared.Tiles;
@@ -60,7 +58,7 @@ public sealed class FloorTileSystem : EntitySystem
         if (!TryComp<StackComponent>(uid, out var stack))
             return;
 
-        if (component.OutputTiles == null)
+        if (component.Outputs == null)
             return;
 
         // this looks a bit sussy but it might be because it needs to be able to place off of grids and expand them
@@ -127,7 +125,7 @@ public sealed class FloorTileSystem : EntitySystem
         }
         TryComp<MapGridComponent>(location.EntityId, out var mapGrid);
 
-        foreach (var currentTile in component.OutputTiles)
+        foreach (var currentTile in component.Outputs)
         {
             var currentTileDefinition = (ContentTileDefinition) _tileDefinitionManager[currentTile];
 
@@ -167,7 +165,7 @@ public sealed class FloorTileSystem : EntitySystem
                 var gridXform = Transform(grid);
                 _transform.SetWorldPosition((grid, gridXform), locationMap.Position);
                 location = new EntityCoordinates(grid, Vector2.Zero);
-                PlaceAt(args.User, grid, grid.Comp, location, _tileDefinitionManager[component.OutputTiles[0]].TileId, component.PlaceTileSound, grid.Comp.TileSize / 2f);
+                PlaceAt(args.User, grid, grid.Comp, location, _tileDefinitionManager[component.Outputs[0]].TileId, component.PlaceTileSound, grid.Comp.TileSize / 2f);
                 return;
             }
         }