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

@@ -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();
}
}

View 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!;
}
}