* 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
}
// 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();
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;
/// 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.
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]
/// <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();
/// <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.
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),
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),
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++;
-
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
{
[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.
using Robust.Shared.Prototypes;
-using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.List;
namespace Content.Server.Implants.Components;
/// <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();
}
using Content.Shared.Roles;
using JetBrains.Annotations;
using Robust.Shared.Prototypes;
-using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.Set;
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)
{
using Content.Shared.Research.Components;
using Content.Shared.Research.Prototypes;
using JetBrains.Annotations;
+using Robust.Shared.Prototypes;
namespace Content.Server.Research.Systems;
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);
}
}
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}");
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;
/// <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.
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;
/// 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"
};
/// <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"
};
+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;
// 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>())
{
using Content.Shared.DeviceNetwork;
-using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.List;
+using Robust.Shared.Prototypes;
namespace Content.Server.SurveillanceCamera;
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();
}
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;
[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();
}
-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;
/// 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();
}
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;
/// <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.
+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
{
/// <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
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>
+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;
[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()
{
/// <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;
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;
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization;
-using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.List;
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();
}
}
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization;
-using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.List;
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!;
}
}
using System.Collections.Immutable;
using Robust.Shared.Prototypes;
-using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.List;
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);
}
+using System.Linq;
using Content.Shared.Actions;
using Content.Shared.Implants.Components;
using Content.Shared.Interaction;
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;
/// 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)
{
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;
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.
/// <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();
}
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;
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);
/// <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();
}
+using Content.Shared.Maps;
+using Robust.Shared.Prototypes;
+
namespace Content.Shared.Parallax.Biomes.Layers;
/// <summary>
/// <summary>
/// What tiles we're allowed to spawn on, real or biome.
/// </summary>
- List<string> AllowedTiles { get; }
+ List<ProtoId<ContentTileDefinition>> AllowedTiles { get; }
}
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;
/// <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();
}
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;
/// 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.
/// </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>
+using Robust.Shared.Prototypes;
+
namespace Content.Shared.Salvage.Expeditions.Modifiers;
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; }
}
using Content.Shared.Atmos;
using Robust.Shared.Prototypes;
-using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.List;
namespace Content.Shared.Salvage.Expeditions.Modifiers;
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.
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;
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.
using Robust.Shared.Prototypes;
-using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.List;
namespace Content.Shared.Salvage.Expeditions.Modifiers;
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;
}
using Robust.Shared.Prototypes;
-using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.List;
namespace Content.Shared.Salvage.Expeditions.Modifiers;
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.
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;
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.
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;
/// <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.
-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;
/// <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.
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;
[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.
+using Content.Shared.DeviceNetwork;
+using Robust.Shared.Prototypes;
using Robust.Shared.Serialization;
namespace Content.Shared.SurveillanceCamera;
{
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;
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
{
[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")
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;
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;
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
}
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 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;
}
}