Add some more prototype serializers (#5934)

This commit is contained in:
metalgearsloth
2021-12-30 00:48:18 +11:00
committed by GitHub
parent 39e42899ca
commit 88bdf0ce61
24 changed files with 78 additions and 39 deletions

View File

@@ -5,6 +5,7 @@ using Robust.Shared.IoC;
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization;
using Robust.Shared.Serialization.Manager.Attributes;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.Dictionary;
using Robust.Shared.Utility;
using Robust.Shared.ViewVariables;
@@ -27,7 +28,7 @@ namespace Content.Shared.Research.Prototypes
[DataField("description")]
private string _description = string.Empty;
[DataField("result")]
[DataField("result", customTypeSerializer:typeof(PrototypeIdSerializer<EntityPrototype>))]
private string _result = string.Empty;
[DataField("completetime")]

View File

@@ -3,6 +3,7 @@ using System.Collections.Generic;
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization;
using Robust.Shared.Serialization.Manager.Attributes;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.List;
using Robust.Shared.Utility;
using Robust.Shared.ViewVariables;
@@ -56,7 +57,7 @@ namespace Content.Shared.Research.Prototypes
/// A list of recipe IDs this technology unlocks.
/// </summary>
[ViewVariables]
[DataField("unlockedRecipes")]
[DataField("unlockedRecipes", customTypeSerializer:typeof(PrototypeIdListSerializer<EntityPrototype>))]
public List<string> UnlockedRecipes { get; } = new();
}
}