Changes for prototype load parallelization (#13066)

Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
This commit is contained in:
Pieter-Jan Briers
2022-12-20 23:25:34 +01:00
committed by GitHub
parent 584921b423
commit a323671984
50 changed files with 169 additions and 249 deletions

View File

@@ -8,8 +8,6 @@ namespace Content.Shared.Construction.Prototypes
[Prototype("construction")]
public sealed class ConstructionPrototype : IPrototype
{
private string _category = string.Empty;
[DataField("conditions")] private List<IConstructionCondition> _conditions = new();
/// <summary>
@@ -54,12 +52,7 @@ namespace Content.Shared.Construction.Prototypes
[DataField("canBuildInImpassable")]
public bool CanBuildInImpassable { get; private set; }
[DataField("category")]
public string Category
{
get => _category;
private set => _category = Loc.GetString(value);
}
[DataField("category")] public string Category { get; private set; } = "";
[DataField("objectType")] public ConstructionType Type { get; private set; } = ConstructionType.Structure;

View File

@@ -1,4 +1,5 @@
using Robust.Shared.Serialization.Manager;
using Robust.Shared.Serialization;
using Robust.Shared.Serialization.Manager;
using Robust.Shared.Serialization.Markdown.Mapping;
using Robust.Shared.Serialization.Markdown.Validation;
using Robust.Shared.Serialization.TypeSerializers.Interfaces;
@@ -41,7 +42,7 @@ namespace Content.Shared.Construction.Steps
public ConstructionGraphStep Read(ISerializationManager serializationManager,
MappingDataNode node,
IDependencyCollection dependencies,
bool skipHook,
SerializationHookContext hookCtx,
ISerializationContext? context = null,
ISerializationManager.InstantiationDelegate<ConstructionGraphStep>? instanceProvider = null)
{
@@ -49,7 +50,7 @@ namespace Content.Shared.Construction.Steps
throw new ArgumentException(
"Tried to convert invalid YAML node mapping to ConstructionGraphStep!");
return (ConstructionGraphStep)serializationManager.Read(type, node, context, skipHook)!;
return (ConstructionGraphStep)serializationManager.Read(type, node, hookCtx, context)!;
}
public ValidationNode Validate(ISerializationManager serializationManager, MappingDataNode node,