diff --git a/Content.Shared/Mobs/Components/MobStateComponent.cs b/Content.Shared/Mobs/Components/MobStateComponent.cs index cf0d4d9d4cf..09ee595c92d 100644 --- a/Content.Shared/Mobs/Components/MobStateComponent.cs +++ b/Content.Shared/Mobs/Components/MobStateComponent.cs @@ -28,7 +28,7 @@ namespace Content.Shared.Mobs.Components; public sealed partial class MobStateComponent : Component { - [DataField("mobStateParams", customTypeSerializer: typeof(PrototypeIdDictionarySerializer))] + [DataField("mobStateParams")] public Dictionary InitMobStateParams = new() { {"Alive", "AliveDefault" }, @@ -191,32 +191,3 @@ public sealed partial class MobStateParametersPrototype : IPrototype, IInheritin [DataField] public float StrippingTimeMultiplier = 1f; } - -public class PrototypeIdDictionarySerializer : - ITypeValidator, MappingDataNode> where TPrototype : class, IPrototype -{ - protected virtual PrototypeIdSerializer PrototypeSerializer => new(); - - public ValidationNode Validate(ISerializationManager serializationManager, MappingDataNode node, - IDependencyCollection dependencies, ISerializationContext? context = null) - { - var mapping = new Dictionary(); - - foreach (var (key, val) in node.Children) - { - var keyVal = serializationManager.ValidateNode(key, context); - - var listVal = (val is ValueDataNode valuenode) - ? PrototypeSerializer.Validate(serializationManager, valuenode, dependencies, context) - : new ErrorNode(val, "PrototypeIdDictionarySerializer failed to get ValueDataNode"); - - mapping.Add(keyVal, listVal); - } - - return new ValidatedMappingNode(mapping); - } - - public ValidationNode Validate(ISerializationManager serializationManager, ValueDataNode node, - IDependencyCollection dependencies, ISerializationContext? context = null) => - PrototypeSerializer.Validate(serializationManager, node, dependencies, context); -}