Add prototype serialization tests. (#18458)

Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
This commit is contained in:
Leon Friedrich
2023-08-06 14:47:45 +12:00
committed by GitHub
parent b97be440dd
commit 28a5e32f5e
18 changed files with 138 additions and 53 deletions

View File

@@ -19,6 +19,7 @@ public sealed class BodyPrototypeSerializer : ITypeReader<BodyPrototype, Mapping
{
var nodes = new List<ValidationNode>();
var prototypes = dependencies.Resolve<IPrototypeManager>();
var factory = dependencies.Resolve<IComponentFactory>();
var connections = new List<string>();
if (slot.TryGet("connections", out SequenceDataNode? connectionsNode))
@@ -57,7 +58,7 @@ public sealed class BodyPrototypeSerializer : ITypeReader<BodyPrototype, Mapping
continue;
}
if (!organPrototype.HasComponent<OrganComponent>())
if (!organPrototype.HasComponent<OrganComponent>(factory))
{
nodes.Add(new ErrorNode(value, $"Organ {organ.Value} does not have a body component"));
}