Replace usages of customTypeSerializer PrototypeIdListSerializer with something that doesn't take 20 separate words to type out (#37959)

* 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
This commit is contained in:
DrSmugleaf
2025-07-09 20:06:51 -07:00
committed by GitHub
parent 326712faca
commit 00826aaad6
39 changed files with 184 additions and 155 deletions

View File

@@ -38,7 +38,7 @@ public sealed partial class SurveillanceCameraSetupWindow : DefaultWindow
} }
// Pass in a list of frequency prototype IDs. // 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(); NetworkSelector.Clear();

View File

@@ -1,7 +1,6 @@
using Content.Shared.Arcade; using Content.Shared.Arcade;
using Robust.Shared.Audio; using Robust.Shared.Audio;
using Robust.Shared.Prototypes; using Robust.Shared.Prototypes;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.List;
namespace Content.Server.Arcade.SpaceVillain; 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. /// The prototypes that can be dispensed as a reward for winning the game.
/// </summary> /// </summary>
[ViewVariables(VVAccess.ReadWrite)] [ViewVariables(VVAccess.ReadWrite)]
[DataField("possibleRewards", customTypeSerializer: typeof(PrototypeIdListSerializer<EntityPrototype>))] [DataField]
public List<string> PossibleRewards = new(); public List<EntProtoId> PossibleRewards = new();
/// <summary> /// <summary>
/// The minimum number of prizes the arcade machine can have. /// The minimum number of prizes the arcade machine can have.

View File

@@ -1,17 +1,14 @@
using Content.Server.Botany.Components; using Content.Server.Botany.Components;
using Content.Server.Botany.Systems; using Content.Server.Botany.Systems;
using Content.Server.EntityEffects;
using Content.Shared.Atmos; using Content.Shared.Atmos;
using Content.Shared.Database; using Content.Shared.Database;
using Content.Shared.EntityEffects;
using Content.Shared.Random; using Content.Shared.Random;
using Robust.Shared.Audio; using Robust.Shared.Audio;
using Robust.Shared.Prototypes; using Robust.Shared.Prototypes;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype; using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.List;
using Robust.Shared.Utility; using Robust.Shared.Utility;
using Content.Server.EntityEffects;
namespace Content.Server.Botany; namespace Content.Server.Botany;
[Prototype] [Prototype]
@@ -133,8 +130,8 @@ public partial class SeedData
/// <summary> /// <summary>
/// The entity prototype this seed spawns when it gets harvested. /// The entity prototype this seed spawns when it gets harvested.
/// </summary> /// </summary>
[DataField("productPrototypes", customTypeSerializer: typeof(PrototypeIdListSerializer<EntityPrototype>))] [DataField]
public List<string> ProductPrototypes = new(); public List<EntProtoId> ProductPrototypes = new();
[DataField] public Dictionary<string, SeedChemQuantity> Chemicals = new(); [DataField] public Dictionary<string, SeedChemQuantity> Chemicals = new();
@@ -243,8 +240,8 @@ public partial class SeedData
/// <summary> /// <summary>
/// The seed prototypes this seed may mutate into when prompted to. /// The seed prototypes this seed may mutate into when prompted to.
/// </summary> /// </summary>
[DataField(customTypeSerializer: typeof(PrototypeIdListSerializer<SeedPrototype>))] [DataField]
public List<string> MutationPrototypes = new(); public List<ProtoId<SeedPrototype>> MutationPrototypes = new();
/// <summary> /// <summary>
/// Log impact for when the seed is planted. /// Log impact for when the seed is planted.
@@ -270,8 +267,8 @@ public partial class SeedData
Mysterious = Mysterious, Mysterious = Mysterious,
PacketPrototype = PacketPrototype, PacketPrototype = PacketPrototype,
ProductPrototypes = new List<string>(ProductPrototypes), ProductPrototypes = new List<EntProtoId>(ProductPrototypes),
MutationPrototypes = new List<string>(MutationPrototypes), MutationPrototypes = new List<ProtoId<SeedPrototype>>(MutationPrototypes),
Chemicals = new Dictionary<string, SeedChemQuantity>(Chemicals), Chemicals = new Dictionary<string, SeedChemQuantity>(Chemicals),
ConsumeGasses = new Dictionary<Gas, float>(ConsumeGasses), ConsumeGasses = new Dictionary<Gas, float>(ConsumeGasses),
ExudeGasses = new Dictionary<Gas, float>(ExudeGasses), ExudeGasses = new Dictionary<Gas, float>(ExudeGasses),
@@ -330,8 +327,8 @@ public partial class SeedData
Mysterious = other.Mysterious, Mysterious = other.Mysterious,
PacketPrototype = other.PacketPrototype, PacketPrototype = other.PacketPrototype,
ProductPrototypes = new List<string>(other.ProductPrototypes), ProductPrototypes = new List<EntProtoId>(other.ProductPrototypes),
MutationPrototypes = new List<string>(other.MutationPrototypes), MutationPrototypes = new List<ProtoId<SeedPrototype>>(other.MutationPrototypes),
Chemicals = new Dictionary<string, SeedChemQuantity>(Chemicals), Chemicals = new Dictionary<string, SeedChemQuantity>(Chemicals),
ConsumeGasses = new Dictionary<Gas, float>(ConsumeGasses), ConsumeGasses = new Dictionary<Gas, float>(ConsumeGasses),

View File

@@ -43,7 +43,7 @@ namespace Content.Server.EntityList
var i = 0; 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); EntityManager.SpawnEntity(entity.ID, EntityManager.GetComponent<TransformComponent>(attached).Coordinates);
i++; i++;

View File

@@ -1,8 +1,6 @@
using Content.Server.Maps; using Content.Server.Maps;
using Robust.Shared.Prototypes; using Robust.Shared.Prototypes;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype; using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.List;
namespace Content.Server.GameTicking.Presets namespace Content.Server.GameTicking.Presets
{ {
@@ -33,8 +31,8 @@ namespace Content.Server.GameTicking.Presets
[DataField("maxPlayers")] [DataField("maxPlayers")]
public int? MaxPlayers; public int? MaxPlayers;
[DataField("rules", customTypeSerializer: typeof(PrototypeIdListSerializer<EntityPrototype>))] [DataField]
public IReadOnlyList<string> Rules { get; private set; } = Array.Empty<string>(); public IReadOnlyList<EntProtoId> Rules { get; private set; } = Array.Empty<EntProtoId>();
/// <summary> /// <summary>
/// If specified, the gamemode will only be run with these maps. /// If specified, the gamemode will only be run with these maps.

View File

@@ -1,5 +1,4 @@
using Robust.Shared.Prototypes; using Robust.Shared.Prototypes;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.List;
namespace Content.Server.Implants.Components; namespace Content.Server.Implants.Components;
@@ -12,6 +11,6 @@ public sealed partial class AutoImplantComponent : Component
/// <summary> /// <summary>
/// List of implants to inject. /// List of implants to inject.
/// </summary> /// </summary>
[DataField("implants", required: true, customTypeSerializer: typeof(PrototypeIdListSerializer<EntityPrototype>))] [DataField(required: true)]
public List<string> Implants = new(); public List<EntProtoId> Implants = new();
} }

View File

@@ -2,7 +2,6 @@
using Content.Shared.Roles; using Content.Shared.Roles;
using JetBrains.Annotations; using JetBrains.Annotations;
using Robust.Shared.Prototypes; using Robust.Shared.Prototypes;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.Set;
namespace Content.Server.Jobs; namespace Content.Server.Jobs;
@@ -12,8 +11,8 @@ namespace Content.Server.Jobs;
[UsedImplicitly] [UsedImplicitly]
public sealed partial class AddImplantSpecial : JobSpecial public sealed partial class AddImplantSpecial : JobSpecial
{ {
[DataField("implants", customTypeSerializer: typeof(PrototypeIdHashSetSerializer<EntityPrototype>))] [DataField]
public HashSet<String> Implants { get; private set; } = new(); public HashSet<EntProtoId> Implants { get; private set; } = new();
public override void AfterEquip(EntityUid mob) public override void AfterEquip(EntityUid mob)
{ {

View File

@@ -2,6 +2,7 @@ using Content.Shared.Database;
using Content.Shared.Research.Components; using Content.Shared.Research.Components;
using Content.Shared.Research.Prototypes; using Content.Shared.Research.Prototypes;
using JetBrains.Annotations; using JetBrains.Annotations;
using Robust.Shared.Prototypes;
namespace Content.Server.Research.Systems; namespace Content.Server.Research.Systems;
@@ -165,9 +166,9 @@ public sealed partial class ResearchSystem
return; return;
component.MainDiscipline = null; component.MainDiscipline = null;
component.CurrentTechnologyCards = new List<string>(); component.CurrentTechnologyCards = new List<string>();
component.SupportedDisciplines = new List<string>(); component.SupportedDisciplines = new List<ProtoId<TechDisciplinePrototype>>();
component.UnlockedTechnologies = new List<string>(); component.UnlockedTechnologies = new List<ProtoId<TechnologyPrototype>>();
component.UnlockedRecipes = new List<string>(); component.UnlockedRecipes = new List<ProtoId<LatheRecipePrototype>>();
Dirty(uid, component); Dirty(uid, component);
} }
} }

View File

@@ -199,7 +199,7 @@ public sealed partial class BorgSystem
else else
{ {
item = component.ProvidedContainer.ContainedEntities item = component.ProvidedContainer.ContainedEntities
.FirstOrDefault(ent => Prototype(ent)?.ID == itemProto); .FirstOrDefault(ent => Prototype(ent)?.ID == itemProto.Id);
if (!item.IsValid()) if (!item.IsValid())
{ {
Log.Debug($"no items found: {component.ProvidedContainer.ContainedEntities.Count}"); Log.Debug($"no items found: {component.ProvidedContainer.ContainedEntities.Count}");

View File

@@ -1,6 +1,6 @@
using Content.Server.StationEvents.Events; using Content.Server.StationEvents.Events;
using Content.Shared.Radio; 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; using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.Set;
namespace Content.Server.StationEvents.Components; namespace Content.Server.StationEvents.Components;
@@ -29,8 +29,8 @@ public sealed partial class SolarFlareRuleComponent : Component
/// <remarks> /// <remarks>
/// Channels are not removed from this, so its possible to roll the same channel multiple times. /// Channels are not removed from this, so its possible to roll the same channel multiple times.
/// </remarks> /// </remarks>
[DataField("extraChannels", customTypeSerializer: typeof(PrototypeIdListSerializer<RadioChannelPrototype>))] [DataField]
public List<String> ExtraChannels = new(); public List<ProtoId<RadioChannelPrototype>> ExtraChannels = new();
/// <summary> /// <summary>
/// Number of times to roll a channel from ExtraChannels. /// Number of times to roll a channel from ExtraChannels.

View File

@@ -1,7 +1,7 @@
using Content.Server.StationEvents.Events; using Content.Server.StationEvents.Events;
using Content.Shared.Chemistry.Reagent; using Content.Shared.Chemistry.Reagent;
using Robust.Shared.Audio; using Robust.Shared.Audio;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.List; using Robust.Shared.Prototypes;
namespace Content.Server.StationEvents.Components; 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. /// 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. /// There is a small chance of using any reagent, ignoring this.
/// </summary> /// </summary>
[DataField(customTypeSerializer: typeof(PrototypeIdListSerializer<ReagentPrototype>))] [DataField]
public IReadOnlyList<string> SafeishVentChemicals = new[] public IReadOnlyList<ProtoId<ReagentPrototype>> SafeishVentChemicals = new ProtoId<ReagentPrototype>[]
{ {
"Water", "Blood", "Slime", "SpaceDrugs", "SpaceCleaner", "Nutriment", "Sugar", "SpaceLube", "Ephedrine", "Ale", "Beer", "SpaceGlue" "Water", "Blood", "Slime", "SpaceDrugs", "SpaceCleaner", "Nutriment", "Sugar", "SpaceLube", "Ephedrine", "Ale", "Beer", "SpaceGlue"
}; };
@@ -45,8 +45,8 @@ public sealed partial class VentClogRuleComponent : Component
/// <summary> /// <summary>
/// Reagents that gets the weak numbers used instead of regular ones. /// Reagents that gets the weak numbers used instead of regular ones.
/// </summary> /// </summary>
[DataField(customTypeSerializer: typeof(PrototypeIdListSerializer<ReagentPrototype>))] [DataField]
public IReadOnlyList<string> WeakReagents = new[] public IReadOnlyList<ProtoId<ReagentPrototype>> WeakReagents = new ProtoId<ReagentPrototype>[]
{ {
"SpaceLube", "SpaceGlue" "SpaceLube", "SpaceGlue"
}; };

View File

@@ -1,14 +1,15 @@
using System.Linq;
using Content.Server.Atmos.Piping.Unary.Components; using Content.Server.Atmos.Piping.Unary.Components;
using Content.Server.Fluids.EntitySystems; using Content.Server.Fluids.EntitySystems;
using Content.Server.StationEvents.Components; using Content.Server.StationEvents.Components;
using Content.Shared.Chemistry.Components; using Content.Shared.Chemistry.Components;
using Content.Shared.Chemistry.Reaction;
using Content.Shared.Chemistry.Reagent; using Content.Shared.Chemistry.Reagent;
using Content.Shared.GameTicking.Components; using Content.Shared.GameTicking.Components;
using Content.Shared.Station.Components; using Content.Shared.Station.Components;
using JetBrains.Annotations; using JetBrains.Annotations;
using Robust.Shared.Prototypes;
using Robust.Shared.Random; using Robust.Shared.Random;
using System.Linq;
using Content.Shared.Chemistry.Reaction;
namespace Content.Server.StationEvents.Events; 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. // TODO: "safe random" for chems. Right now this includes admin chemicals.
var allReagents = PrototypeManager.EnumeratePrototypes<ReagentPrototype>() var allReagents = PrototypeManager.EnumeratePrototypes<ReagentPrototype>()
.Where(x => !x.Abstract) .Where(x => !x.Abstract)
.Select(x => x.ID).ToList(); .Select(x => new ProtoId<ReagentPrototype>(x.ID)).ToList();
foreach (var (_, transform) in EntityQuery<GasVentPumpComponent, TransformComponent>()) foreach (var (_, transform) in EntityQuery<GasVentPumpComponent, TransformComponent>())
{ {

View File

@@ -1,5 +1,5 @@
using Content.Shared.DeviceNetwork; using Content.Shared.DeviceNetwork;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.List; using Robust.Shared.Prototypes;
namespace Content.Server.SurveillanceCamera; namespace Content.Server.SurveillanceCamera;
@@ -43,6 +43,6 @@ public sealed partial class SurveillanceCameraComponent : Component
public bool NetworkSet { get; set; } public bool NetworkSet { get; set; }
// This has to be device network frequency prototypes. // This has to be device network frequency prototypes.
[DataField("setupAvailableNetworks", customTypeSerializer:typeof(PrototypeIdListSerializer<DeviceFrequencyPrototype>))] [DataField("setupAvailableNetworks")]
public List<string> AvailableNetworks { get; private set; } = new(); public List<ProtoId<DeviceFrequencyPrototype>> AvailableNetworks { get; private set; } = new();
} }

View File

@@ -1,6 +1,6 @@
using Content.Shared.DeviceNetwork; using Content.Shared.DeviceNetwork;
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype; using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.List;
namespace Content.Server.SurveillanceCamera; namespace Content.Server.SurveillanceCamera;
@@ -26,6 +26,6 @@ public sealed partial class SurveillanceCameraRouterComponent : Component
[DataField("subnetFrequency", customTypeSerializer:typeof(PrototypeIdSerializer<DeviceFrequencyPrototype>))] [DataField("subnetFrequency", customTypeSerializer:typeof(PrototypeIdSerializer<DeviceFrequencyPrototype>))]
public string? SubnetFrequencyId { get; set; } public string? SubnetFrequencyId { get; set; }
[DataField("setupAvailableNetworks", customTypeSerializer:typeof(PrototypeIdListSerializer<DeviceFrequencyPrototype>))] [DataField("setupAvailableNetworks")]
public List<string> AvailableNetworks { get; private set; } = new(); public List<ProtoId<DeviceFrequencyPrototype>> AvailableNetworks { get; private set; } = new();
} }

View File

@@ -1,6 +1,6 @@
using Content.Server.Worldgen.Systems.Biomes; using Content.Server.Worldgen.Prototypes;
using Content.Server.Worldgen.Prototypes; using Content.Server.Worldgen.Systems.Biomes;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.List; using Robust.Shared.Prototypes;
namespace Content.Server.Worldgen.Components; namespace Content.Server.Worldgen.Components;
@@ -15,7 +15,7 @@ public sealed partial class BiomeSelectionComponent : Component
/// The list of biomes available to this selector. /// The list of biomes available to this selector.
/// </summary> /// </summary>
/// <remarks>This is always sorted by priority after ComponentStartup.</remarks> /// <remarks>This is always sorted by priority after ComponentStartup.</remarks>
[DataField("biomes", required: true, [DataField(required: true)]
customTypeSerializer: typeof(PrototypeIdListSerializer<BiomePrototype>))] public List<string> Biomes = new(); public List<ProtoId<BiomePrototype>> Biomes = new();
} }

View File

@@ -1,6 +1,6 @@
using Content.Server.Worldgen.Systems.Debris; using Content.Server.Worldgen.Systems.Debris;
using Content.Shared.Maps; using Content.Shared.Maps;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.List; using Robust.Shared.Prototypes;
namespace Content.Server.Worldgen.Components.Debris; namespace Content.Server.Worldgen.Components.Debris;
@@ -24,9 +24,8 @@ public sealed partial class BlobFloorPlanBuilderComponent : Component
/// <summary> /// <summary>
/// The tiles to be used for the floor plan. /// The tiles to be used for the floor plan.
/// </summary> /// </summary>
[DataField("floorTileset", required: true, [DataField(required: true)]
customTypeSerializer: typeof(PrototypeIdListSerializer<ContentTileDefinition>))] public List<ProtoId<ContentTileDefinition>> FloorTileset { get; private set; } = default!;
public List<string> FloorTileset { get; private set; } = default!;
/// <summary> /// <summary>
/// The number of floor tiles to place when drawing the asteroid layout. /// The number of floor tiles to place when drawing the asteroid layout.

View 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.Chemistry.Reagent;
using Content.Shared.FixedPoint; using Content.Shared.FixedPoint;
using JetBrains.Annotations; using JetBrains.Annotations;
using Robust.Shared.Prototypes; using Robust.Shared.Prototypes;
using Robust.Shared.Serialization; using Robust.Shared.Serialization;
using Robust.Shared.Utility; using Robust.Shared.Utility;
using System.Collections;
using System.Linq;
using Content.Shared.Chemistry.Components.SolutionManager;
namespace Content.Shared.Chemistry.Components namespace Content.Shared.Chemistry.Components
{ {
@@ -583,6 +583,7 @@ namespace Content.Shared.Chemistry.Components
/// <summary> /// <summary>
/// Splits a solution without the specified reagent prototypes. /// Splits a solution without the specified reagent prototypes.
/// </summary> /// </summary>
[Obsolete("Use SplitSolutionWithout with params ProtoId<ReagentPrototype>")]
public Solution SplitSolutionWithout(FixedPoint2 toTake, params string[] excludedPrototypes) public Solution SplitSolutionWithout(FixedPoint2 toTake, params string[] excludedPrototypes)
{ {
// First remove the blacklisted prototypes // First remove the blacklisted prototypes
@@ -612,6 +613,38 @@ namespace Content.Shared.Chemistry.Components
return sol; 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> /// <summary>
/// Splits a solution with only the specified reagent prototypes. /// Splits a solution with only the specified reagent prototypes.
/// </summary> /// </summary>

View File

@@ -1,24 +1,24 @@
using Content.Shared.Chemistry.Components;
using Content.Shared.Chemistry.Components.SolutionManager;
using Content.Shared.Chemistry.Reaction;
using Content.Shared.Chemistry.Reagent;
using Content.Shared.Examine;
using Content.Shared.FixedPoint;
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.Diagnostics.CodeAnalysis;
using System.Linq; using System.Linq;
using System.Numerics; using System.Numerics;
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
using System.Text; 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.Containers;
using Content.Shared.Examine;
using Content.Shared.FixedPoint;
using Content.Shared.Hands.Components; using Content.Shared.Hands.Components;
using Content.Shared.Hands.EntitySystems; using Content.Shared.Hands.EntitySystems;
using Content.Shared.Verbs;
using JetBrains.Annotations;
using Robust.Shared.Containers;
using Robust.Shared.Map; using Robust.Shared.Map;
using Robust.Shared.Network; using Robust.Shared.Network;
using Robust.Shared.Prototypes;
using Robust.Shared.Utility;
using Dependency = Robust.Shared.IoC.DependencyAttribute; using Dependency = Robust.Shared.IoC.DependencyAttribute;
namespace Content.Shared.Chemistry.EntitySystems; namespace Content.Shared.Chemistry.EntitySystems;
@@ -61,14 +61,14 @@ public partial record struct SolutionAccessAttemptEvent(string SolutionName)
[UsedImplicitly] [UsedImplicitly]
public abstract partial class SharedSolutionContainerSystem : EntitySystem public abstract partial class SharedSolutionContainerSystem : EntitySystem
{ {
[Dependency] protected readonly IPrototypeManager PrototypeManager = default!; [Robust.Shared.IoC.Dependency] protected readonly IPrototypeManager PrototypeManager = default!;
[Dependency] protected readonly ChemicalReactionSystem ChemicalReactionSystem = default!; [Robust.Shared.IoC.Dependency] protected readonly ChemicalReactionSystem ChemicalReactionSystem = default!;
[Dependency] protected readonly ExamineSystemShared ExamineSystem = default!; [Robust.Shared.IoC.Dependency] protected readonly ExamineSystemShared ExamineSystem = default!;
[Dependency] protected readonly SharedAppearanceSystem AppearanceSystem = default!; [Robust.Shared.IoC.Dependency] protected readonly SharedAppearanceSystem AppearanceSystem = default!;
[Dependency] protected readonly SharedHandsSystem Hands = default!; [Robust.Shared.IoC.Dependency] protected readonly SharedHandsSystem Hands = default!;
[Dependency] protected readonly SharedContainerSystem ContainerSystem = default!; [Robust.Shared.IoC.Dependency] protected readonly SharedContainerSystem ContainerSystem = default!;
[Dependency] protected readonly MetaDataSystem MetaDataSys = default!; [Robust.Shared.IoC.Dependency] protected readonly MetaDataSystem MetaDataSys = default!;
[Dependency] protected readonly INetManager NetManager = default!; [Robust.Shared.IoC.Dependency] protected readonly INetManager NetManager = default!;
public override void Initialize() public override void Initialize()
{ {
@@ -376,6 +376,7 @@ public abstract partial class SharedSolutionContainerSystem : EntitySystem
/// <summary> /// <summary>
/// Splits a solution without the specified reagent(s). /// Splits a solution without the specified reagent(s).
/// </summary> /// </summary>
[Obsolete("Use SplitSolutionWithout with params ProtoId<ReagentPrototype>")]
public Solution SplitSolutionWithout(Entity<SolutionComponent> soln, FixedPoint2 quantity, params string[] reagents) public Solution SplitSolutionWithout(Entity<SolutionComponent> soln, FixedPoint2 quantity, params string[] reagents)
{ {
var (uid, comp) = soln; var (uid, comp) = soln;
@@ -386,6 +387,19 @@ public abstract partial class SharedSolutionContainerSystem : EntitySystem
return splitSol; 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) public void RemoveAllSolution(Entity<SolutionComponent> soln)
{ {
var (uid, comp) = soln; var (uid, comp) = soln;

View File

@@ -1,6 +1,5 @@
using Robust.Shared.Prototypes; using Robust.Shared.Prototypes;
using Robust.Shared.Serialization; using Robust.Shared.Serialization;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.List;
namespace Content.Shared.Damage.Prototypes namespace Content.Shared.Damage.Prototypes
{ {
@@ -22,14 +21,14 @@ namespace Content.Shared.Damage.Prototypes
/// <summary> /// <summary>
/// List of damage groups that are supported by this container. /// List of damage groups that are supported by this container.
/// </summary> /// </summary>
[DataField("supportedGroups", customTypeSerializer: typeof(PrototypeIdListSerializer<DamageGroupPrototype>))] [DataField]
public List<string> SupportedGroups = new(); public List<ProtoId<DamageGroupPrototype>> SupportedGroups = new();
/// <summary> /// <summary>
/// Partial List of damage types supported by this container. Note that members of the damage groups listed /// 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. /// in <see cref="SupportedGroups"/> are also supported, but they are not included in this list.
/// </summary> /// </summary>
[DataField("supportedTypes", customTypeSerializer: typeof(PrototypeIdListSerializer<DamageTypePrototype>))] [DataField]
public List<string> SupportedTypes = new(); public List<ProtoId<DamageTypePrototype>> SupportedTypes = new();
} }
} }

View File

@@ -1,6 +1,5 @@
using Robust.Shared.Prototypes; using Robust.Shared.Prototypes;
using Robust.Shared.Serialization; using Robust.Shared.Serialization;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.List;
namespace Content.Shared.Damage.Prototypes namespace Content.Shared.Damage.Prototypes
{ {
@@ -22,7 +21,7 @@ namespace Content.Shared.Damage.Prototypes
[ViewVariables(VVAccess.ReadOnly)] [ViewVariables(VVAccess.ReadOnly)]
public string LocalizedName => Loc.GetString(Name); public string LocalizedName => Loc.GetString(Name);
[DataField("damageTypes", required: true, customTypeSerializer: typeof(PrototypeIdListSerializer<DamageTypePrototype>))] [DataField(required: true)]
public List<string> DamageTypes { get; private set; } = default!; public List<ProtoId<DamageTypePrototype>> DamageTypes { get; private set; } = default!;
} }
} }

View File

@@ -1,6 +1,5 @@
using System.Collections.Immutable; using System.Collections.Immutable;
using Robust.Shared.Prototypes; using Robust.Shared.Prototypes;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.List;
namespace Content.Shared.EntityList namespace Content.Shared.EntityList
{ {
@@ -11,14 +10,14 @@ namespace Content.Shared.EntityList
[IdDataField] [IdDataField]
public string ID { get; private set; } = default!; public string ID { get; private set; } = default!;
[DataField("entities", customTypeSerializer: typeof(PrototypeIdListSerializer<EntityPrototype>))] [DataField]
public ImmutableList<string> EntityIds { get; private set; } = ImmutableList<string>.Empty; 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>(); prototypeManager ??= IoCManager.Resolve<IPrototypeManager>();
foreach (var entityId in EntityIds) foreach (var entityId in Entities)
{ {
yield return prototypeManager.Index<EntityPrototype>(entityId); yield return prototypeManager.Index<EntityPrototype>(entityId);
} }

View File

@@ -1,3 +1,4 @@
using System.Linq;
using Content.Shared.Actions; using Content.Shared.Actions;
using Content.Shared.Implants.Components; using Content.Shared.Implants.Components;
using Content.Shared.Interaction; using Content.Shared.Interaction;
@@ -6,9 +7,7 @@ using Content.Shared.Mobs;
using Content.Shared.Tag; using Content.Shared.Tag;
using JetBrains.Annotations; using JetBrains.Annotations;
using Robust.Shared.Containers; using Robust.Shared.Containers;
using Robust.Shared.Network;
using Robust.Shared.Prototypes; using Robust.Shared.Prototypes;
using System.Linq;
namespace Content.Shared.Implants; namespace Content.Shared.Implants;
@@ -91,7 +90,7 @@ public abstract class SharedSubdermalImplantSystem : EntitySystem
/// Add a list of implants to a person. /// Add a list of implants to a person.
/// Logs any implant ids that don't have <see cref="SubdermalImplantComponent"/>. /// Logs any implant ids that don't have <see cref="SubdermalImplantComponent"/>.
/// </summary> /// </summary>
public void AddImplants(EntityUid uid, IEnumerable<String> implants) public void AddImplants(EntityUid uid, IEnumerable<EntProtoId> implants)
{ {
foreach (var id in implants) foreach (var id in implants)
{ {

View File

@@ -1,8 +1,8 @@
using Content.Shared.Decals; using Content.Shared.Decals;
using Content.Shared.Maps; using Content.Shared.Maps;
using Robust.Shared.Noise; using Robust.Shared.Noise;
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization; using Robust.Shared.Serialization;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.List;
namespace Content.Shared.Parallax.Biomes.Layers; namespace Content.Shared.Parallax.Biomes.Layers;
@@ -10,8 +10,8 @@ namespace Content.Shared.Parallax.Biomes.Layers;
public sealed partial class BiomeDecalLayer : IBiomeWorldLayer public sealed partial class BiomeDecalLayer : IBiomeWorldLayer
{ {
/// <inheritdoc/> /// <inheritdoc/>
[DataField("allowedTiles", customTypeSerializer:typeof(PrototypeIdListSerializer<ContentTileDefinition>))] [DataField]
public List<string> AllowedTiles { get; private set; } = new(); public List<ProtoId<ContentTileDefinition>> AllowedTiles { get; private set; } = new();
/// <summary> /// <summary>
/// Divide each tile up by this amount. /// Divide each tile up by this amount.
@@ -29,6 +29,6 @@ public sealed partial class BiomeDecalLayer : IBiomeWorldLayer
/// <inheritdoc/> /// <inheritdoc/>
[DataField("invert")] public bool Invert { get; private set; } = false; [DataField("invert")] public bool Invert { get; private set; } = false;
[DataField("decals", required: true, customTypeSerializer:typeof(PrototypeIdListSerializer<DecalPrototype>))] [DataField(required: true)]
public List<string> Decals = new(); public List<ProtoId<DecalPrototype>> Decals = new();
} }

View File

@@ -2,7 +2,6 @@ using Content.Shared.Maps;
using Robust.Shared.Noise; using Robust.Shared.Noise;
using Robust.Shared.Prototypes; using Robust.Shared.Prototypes;
using Robust.Shared.Serialization; using Robust.Shared.Serialization;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.List;
namespace Content.Shared.Parallax.Biomes.Layers; namespace Content.Shared.Parallax.Biomes.Layers;
@@ -10,8 +9,8 @@ namespace Content.Shared.Parallax.Biomes.Layers;
public sealed partial class BiomeEntityLayer : IBiomeWorldLayer public sealed partial class BiomeEntityLayer : IBiomeWorldLayer
{ {
/// <inheritdoc/> /// <inheritdoc/>
[DataField("allowedTiles", customTypeSerializer:typeof(PrototypeIdListSerializer<ContentTileDefinition>))] [DataField]
public List<string> AllowedTiles { get; private set; } = new(); public List<ProtoId<ContentTileDefinition>> AllowedTiles { get; private set; } = new();
[DataField("noise")] public FastNoiseLite Noise { get; private set; } = new(0); [DataField("noise")] public FastNoiseLite Noise { get; private set; } = new(0);
@@ -22,6 +21,6 @@ public sealed partial class BiomeEntityLayer : IBiomeWorldLayer
/// <inheritdoc/> /// <inheritdoc/>
[DataField("invert")] public bool Invert { get; private set; } = false; [DataField("invert")] public bool Invert { get; private set; } = false;
[DataField("entities", required: true, customTypeSerializer: typeof(PrototypeIdListSerializer<EntityPrototype>))] [DataField(required: true)]
public List<string> Entities = new(); public List<EntProtoId> Entities = new();
} }

View File

@@ -1,3 +1,6 @@
using Content.Shared.Maps;
using Robust.Shared.Prototypes;
namespace Content.Shared.Parallax.Biomes.Layers; namespace Content.Shared.Parallax.Biomes.Layers;
/// <summary> /// <summary>
@@ -8,5 +11,5 @@ public partial interface IBiomeWorldLayer : IBiomeLayer
/// <summary> /// <summary>
/// What tiles we're allowed to spawn on, real or biome. /// What tiles we're allowed to spawn on, real or biome.
/// </summary> /// </summary>
List<string> AllowedTiles { get; } List<ProtoId<ContentTileDefinition>> AllowedTiles { get; }
} }

View File

@@ -1,8 +1,7 @@
using Content.Shared.Chemistry.Reagent; using Content.Shared.Chemistry.Reagent;
using Content.Shared.FixedPoint; using Content.Shared.FixedPoint;
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization; 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; namespace Content.Shared.Random;
@@ -28,6 +27,6 @@ public sealed partial class RandomFillSolution
/// <summary> /// <summary>
/// Listed reagents that the weight and quantity apply to. /// Listed reagents that the weight and quantity apply to.
/// </summary> /// </summary>
[DataField("reagents", required: true, customTypeSerializer: typeof(PrototypeIdListSerializer<ReagentPrototype>))] [DataField(required: true)]
public List<string> Reagents = new(); public List<ProtoId<ReagentPrototype>> Reagents = new();
} }

View File

@@ -2,8 +2,8 @@ using Content.Shared.Lathe;
using Content.Shared.Research.Prototypes; using Content.Shared.Research.Prototypes;
using Content.Shared.Research.Systems; using Content.Shared.Research.Systems;
using Robust.Shared.GameStates; using Robust.Shared.GameStates;
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype; using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.List;
namespace Content.Shared.Research.Components; namespace Content.Shared.Research.Components;
@@ -25,15 +25,15 @@ public sealed partial class TechnologyDatabaseComponent : Component
/// Which research disciplines are able to be unlocked /// Which research disciplines are able to be unlocked
/// </summary> /// </summary>
[AutoNetworkedField] [AutoNetworkedField]
[DataField("supportedDisciplines", customTypeSerializer: typeof(PrototypeIdListSerializer<TechDisciplinePrototype>))] [DataField]
public List<string> SupportedDisciplines = new(); public List<ProtoId<TechDisciplinePrototype>> SupportedDisciplines = new();
/// <summary> /// <summary>
/// The ids of all the technologies which have been unlocked. /// The ids of all the technologies which have been unlocked.
/// </summary> /// </summary>
[AutoNetworkedField] [AutoNetworkedField]
[DataField("unlockedTechnologies", customTypeSerializer: typeof(PrototypeIdListSerializer<TechnologyPrototype>))] [DataField]
public List<string> UnlockedTechnologies = new(); public List<ProtoId<TechnologyPrototype>> UnlockedTechnologies = new();
/// <summary> /// <summary>
/// The ids of all the lathe recipes which have been unlocked. /// The ids of all the lathe recipes which have been unlocked.
@@ -41,8 +41,8 @@ public sealed partial class TechnologyDatabaseComponent : Component
/// </summary> /// </summary>
/// todo: if you unlock all the recipes in a tech, it doesn't count as unlocking the tech. sadge /// todo: if you unlock all the recipes in a tech, it doesn't count as unlocking the tech. sadge
[AutoNetworkedField] [AutoNetworkedField]
[DataField("unlockedRecipes", customTypeSerializer: typeof(PrototypeIdListSerializer<LatheRecipePrototype>))] [DataField]
public List<string> UnlockedRecipes = new(); public List<ProtoId<LatheRecipePrototype>> UnlockedRecipes = new();
} }
/// <summary> /// <summary>

View File

@@ -1,3 +1,5 @@
using Robust.Shared.Prototypes;
namespace Content.Shared.Salvage.Expeditions.Modifiers; namespace Content.Shared.Salvage.Expeditions.Modifiers;
public interface IBiomeSpecificMod : ISalvageMod public interface IBiomeSpecificMod : ISalvageMod
@@ -5,5 +7,5 @@ public interface IBiomeSpecificMod : ISalvageMod
/// <summary> /// <summary>
/// Whitelist for biomes. If null then any biome is allowed. /// Whitelist for biomes. If null then any biome is allowed.
/// </summary> /// </summary>
List<string>? Biomes { get; } List<ProtoId<SalvageBiomeModPrototype>>? Biomes { get; }
} }

View File

@@ -1,6 +1,5 @@
using Content.Shared.Atmos; using Content.Shared.Atmos;
using Robust.Shared.Prototypes; using Robust.Shared.Prototypes;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.List;
namespace Content.Shared.Salvage.Expeditions.Modifiers; namespace Content.Shared.Salvage.Expeditions.Modifiers;
@@ -24,8 +23,8 @@ public sealed partial class SalvageAirMod : IPrototype, IBiomeSpecificMod
public float Cost { get; private set; } = 0f; public float Cost { get; private set; } = 0f;
/// <inheritdoc/> /// <inheritdoc/>
[DataField("biomes", customTypeSerializer: typeof(PrototypeIdListSerializer<SalvageBiomeModPrototype>))] [DataField]
public List<string>? Biomes { get; private set; } = null; public List<ProtoId<SalvageBiomeModPrototype>>? Biomes { get; private set; } = null;
/// <summary> /// <summary>
/// Set to true if this planet will have no atmosphere. /// Set to true if this planet will have no atmosphere.

View File

@@ -1,7 +1,5 @@
using Content.Shared.Procedural; using Content.Shared.Procedural;
using Robust.Shared.Prototypes; 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; namespace Content.Shared.Salvage.Expeditions.Modifiers;
@@ -17,8 +15,8 @@ public sealed partial class SalvageDungeonModPrototype : IPrototype, IBiomeSpeci
public float Cost { get; private set; } = 0f; public float Cost { get; private set; } = 0f;
/// <inheridoc/> /// <inheridoc/>
[DataField("biomes", customTypeSerializer: typeof(PrototypeIdListSerializer<SalvageBiomeModPrototype>))] [DataField]
public List<string>? Biomes { get; private set; } = null; public List<ProtoId<SalvageBiomeModPrototype>>? Biomes { get; private set; } = null;
/// <summary> /// <summary>
/// The config to use for spawning the dungeon. /// The config to use for spawning the dungeon.

View File

@@ -1,5 +1,4 @@
using Robust.Shared.Prototypes; using Robust.Shared.Prototypes;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.List;
namespace Content.Shared.Salvage.Expeditions.Modifiers; namespace Content.Shared.Salvage.Expeditions.Modifiers;
@@ -15,8 +14,8 @@ public sealed partial class SalvageLightMod : IPrototype, IBiomeSpecificMod
public float Cost { get; private set; } = 0f; public float Cost { get; private set; } = 0f;
/// <inheritdoc/> /// <inheritdoc/>
[DataField("biomes", customTypeSerializer: typeof(PrototypeIdListSerializer<SalvageBiomeModPrototype>))] [DataField]
public List<string>? Biomes { get; private set; } = null; public List<ProtoId<SalvageBiomeModPrototype>>? Biomes { get; private set; } = null;
[DataField("color", required: true)] public Color? Color; [DataField("color", required: true)] public Color? Color;
} }

View File

@@ -1,5 +1,4 @@
using Robust.Shared.Prototypes; using Robust.Shared.Prototypes;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.List;
namespace Content.Shared.Salvage.Expeditions.Modifiers; namespace Content.Shared.Salvage.Expeditions.Modifiers;
@@ -15,8 +14,8 @@ public sealed partial class SalvageTemperatureMod : IPrototype, IBiomeSpecificMo
public float Cost { get; private set; } = 0f; public float Cost { get; private set; } = 0f;
/// <inheritdoc/> /// <inheritdoc/>
[DataField("biomes", customTypeSerializer: typeof(PrototypeIdListSerializer<SalvageBiomeModPrototype>))] [DataField]
public List<string>? Biomes { get; private set; } = null; public List<ProtoId<SalvageBiomeModPrototype>>? Biomes { get; private set; } = null;
/// <summary> /// <summary>
/// Temperature in the planets air mix. /// Temperature in the planets air mix.

View File

@@ -1,7 +1,6 @@
using Content.Shared.Weather; using Content.Shared.Weather;
using Robust.Shared.Prototypes; using Robust.Shared.Prototypes;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype; using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.List;
namespace Content.Shared.Salvage.Expeditions.Modifiers; namespace Content.Shared.Salvage.Expeditions.Modifiers;
@@ -17,8 +16,8 @@ public sealed partial class SalvageWeatherMod : IPrototype, IBiomeSpecificMod
public float Cost { get; private set; } = 0f; public float Cost { get; private set; } = 0f;
/// <inheritdoc/> /// <inheritdoc/>
[DataField("biomes", customTypeSerializer: typeof(PrototypeIdListSerializer<SalvageBiomeModPrototype>))] [DataField]
public List<string>? Biomes { get; private set; } = null; public List<ProtoId<SalvageBiomeModPrototype>>? Biomes { get; private set; } = null;
/// <summary> /// <summary>
/// Weather prototype to use on the planet. /// Weather prototype to use on the planet.

View File

@@ -1,7 +1,6 @@
using Robust.Shared.Containers; using Robust.Shared.Containers;
using Robust.Shared.GameStates; using Robust.Shared.GameStates;
using Robust.Shared.Prototypes; using Robust.Shared.Prototypes;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.List;
namespace Content.Shared.Silicons.Borgs.Components; namespace Content.Shared.Silicons.Borgs.Components;
@@ -14,8 +13,8 @@ public sealed partial class ItemBorgModuleComponent : Component
/// <summary> /// <summary>
/// The items that are provided. /// The items that are provided.
/// </summary> /// </summary>
[DataField("items", customTypeSerializer: typeof(PrototypeIdListSerializer<EntityPrototype>), required: true)] [DataField(required: true)]
public List<string> Items = new(); public List<EntProtoId> Items = new();
/// <summary> /// <summary>
/// The entities from <see cref="Items"/> that were spawned. /// The entities from <see cref="Items"/> that were spawned.

View 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;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.List;
namespace Content.Shared.Silicons.Laws; namespace Content.Shared.Silicons.Laws;
@@ -71,8 +69,8 @@ public sealed partial class SiliconLawsetPrototype : IPrototype
/// <summary> /// <summary>
/// List of law prototype ids in this lawset. /// List of law prototype ids in this lawset.
/// </summary> /// </summary>
[DataField(required: true, customTypeSerializer: typeof(PrototypeIdListSerializer<SiliconLawPrototype>))] [DataField(required: true)]
public List<string> Laws = new(); public List<ProtoId<SiliconLawPrototype>> Laws = new();
/// <summary> /// <summary>
/// What entity the lawset considers as a figure of authority. /// What entity the lawset considers as a figure of authority.

View File

@@ -4,7 +4,6 @@ using Robust.Shared.GameStates;
using Robust.Shared.Prototypes; using Robust.Shared.Prototypes;
using Robust.Shared.Serialization; using Robust.Shared.Serialization;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype; 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; using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.Dictionary;
namespace Content.Shared.Singularity.Components; namespace Content.Shared.Singularity.Components;
@@ -31,8 +30,8 @@ public sealed partial class EmitterComponent : Component
[DataField("boltType", customTypeSerializer: typeof(PrototypeIdSerializer<EntityPrototype>))] [DataField("boltType", customTypeSerializer: typeof(PrototypeIdSerializer<EntityPrototype>))]
public string BoltType = "EmitterBolt"; public string BoltType = "EmitterBolt";
[DataField("selectableTypes", customTypeSerializer: typeof(PrototypeIdListSerializer<EntityPrototype>))] [DataField]
public List<string> SelectableTypes = new(); public List<EntProtoId> SelectableTypes = new();
/// <summary> /// <summary>
/// The current amount of power being used. /// The current amount of power being used.

View File

@@ -1,3 +1,5 @@
using Content.Shared.DeviceNetwork;
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization; using Robust.Shared.Serialization;
namespace Content.Shared.SurveillanceCamera; namespace Content.Shared.SurveillanceCamera;
@@ -83,11 +85,11 @@ public sealed class SurveillanceCameraSetupBoundUiState : BoundUserInterfaceStat
{ {
public string Name { get; } public string Name { get; }
public uint Network { get; } public uint Network { get; }
public List<string> Networks { get; } public List<ProtoId<DeviceFrequencyPrototype>> Networks { get; }
public bool NameDisabled { get; } public bool NameDisabled { get; }
public bool NetworkDisabled { 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; Name = name;
Network = network; Network = network;

View File

@@ -1,7 +1,7 @@
using Content.Shared.Maps; using Content.Shared.Maps;
using Robust.Shared.Audio; using Robust.Shared.Audio;
using Robust.Shared.GameStates; using Robust.Shared.GameStates;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.List; using Robust.Shared.Prototypes;
namespace Content.Shared.Tiles namespace Content.Shared.Tiles
{ {
@@ -12,8 +12,8 @@ namespace Content.Shared.Tiles
[RegisterComponent, NetworkedComponent] [RegisterComponent, NetworkedComponent]
public sealed partial class FloorTileComponent : Component public sealed partial class FloorTileComponent : Component
{ {
[DataField("outputs", customTypeSerializer: typeof(PrototypeIdListSerializer<ContentTileDefinition>))] [DataField]
public List<string>? OutputTiles; public List<ProtoId<ContentTileDefinition>>? Outputs;
[DataField("placeTileSound")] public SoundSpecifier PlaceTileSound = [DataField("placeTileSound")] public SoundSpecifier PlaceTileSound =
new SoundPathSpecifier("/Audio/Items/genhit.ogg") new SoundPathSpecifier("/Audio/Items/genhit.ogg")

View File

@@ -2,7 +2,6 @@ using System.Diagnostics.CodeAnalysis;
using System.Linq; using System.Linq;
using System.Numerics; using System.Numerics;
using Content.Shared.Administration.Logs; using Content.Shared.Administration.Logs;
using Content.Shared.Audio;
using Content.Shared.Database; using Content.Shared.Database;
using Content.Shared.Interaction; using Content.Shared.Interaction;
using Content.Shared.Maps; using Content.Shared.Maps;
@@ -17,7 +16,6 @@ using Robust.Shared.Network;
using Robust.Shared.Physics; using Robust.Shared.Physics;
using Robust.Shared.Physics.Components; using Robust.Shared.Physics.Components;
using Robust.Shared.Physics.Systems; using Robust.Shared.Physics.Systems;
using Robust.Shared.Random;
using Robust.Shared.Timing; using Robust.Shared.Timing;
namespace Content.Shared.Tiles; namespace Content.Shared.Tiles;
@@ -60,7 +58,7 @@ public sealed class FloorTileSystem : EntitySystem
if (!TryComp<StackComponent>(uid, out var stack)) if (!TryComp<StackComponent>(uid, out var stack))
return; return;
if (component.OutputTiles == null) if (component.Outputs == null)
return; return;
// this looks a bit sussy but it might be because it needs to be able to place off of grids and expand them // 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); TryComp<MapGridComponent>(location.EntityId, out var mapGrid);
foreach (var currentTile in component.OutputTiles) foreach (var currentTile in component.Outputs)
{ {
var currentTileDefinition = (ContentTileDefinition) _tileDefinitionManager[currentTile]; var currentTileDefinition = (ContentTileDefinition) _tileDefinitionManager[currentTile];
@@ -167,7 +165,7 @@ public sealed class FloorTileSystem : EntitySystem
var gridXform = Transform(grid); var gridXform = Transform(grid);
_transform.SetWorldPosition((grid, gridXform), locationMap.Position); _transform.SetWorldPosition((grid, gridXform), locationMap.Position);
location = new EntityCoordinates(grid, Vector2.Zero); 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; return;
} }
} }