serv4 + submodule update (#12740)

Co-authored-by: DrSmugleaf <DrSmugleaf@users.noreply.github.com>
This commit is contained in:
Paul Ritter
2022-11-27 19:25:55 +01:00
committed by GitHub
parent 7608c24b63
commit 3884c4d3db
46 changed files with 230 additions and 302 deletions

View File

@@ -39,10 +39,12 @@ public sealed class HTNTaskListSerializer : ITypeSerializer<List<string>, Sequen
return new ValidatedSequenceNode(list);
}
public List<string> Read(ISerializationManager serializationManager, SequenceDataNode node, IDependencyCollection dependencies,
bool skipHook, ISerializationContext? context = null, List<string>? value = default)
public List<string> Read(ISerializationManager serializationManager, SequenceDataNode node,
IDependencyCollection dependencies,
bool skipHook, ISerializationContext? context = null,
ISerializationManager.InstantiationDelegate<List<string>>? instanceProvider = null)
{
value ??= new List<string>();
var value = instanceProvider != null ? instanceProvider() : new List<string>();
foreach (var data in node.Sequence)
{
var mapping = (MappingDataNode) data;
@@ -72,15 +74,4 @@ public sealed class HTNTaskListSerializer : ITypeSerializer<List<string>, Sequen
return sequence;
}
public List<string> Copy(ISerializationManager serializationManager, List<string> source, List<string> target, bool skipHook,
ISerializationContext? context = null)
{
target.Clear();
target.EnsureCapacity(source.Capacity);
// Tasks are just prototypes soooo?
target.AddRange(source);
return target;
}
}