Make MappingDataNode use string keys (#36111)

* MappingDataNode string keys

* a

* poke
This commit is contained in:
Leon Friedrich
2025-04-18 19:28:22 +10:00
committed by GitHub
parent 644cce2b9f
commit e4f3d19094
6 changed files with 19 additions and 34 deletions

View File

@@ -23,11 +23,11 @@ public sealed class NPCBlackboardSerializer : ITypeReader<NPCBlackboard, Mapping
foreach (var data in node)
{
var key = data.Key.ToYamlNode().AsString();
var key = data.Key;
if (data.Value.Tag == null)
{
validated.Add(new ErrorNode(data.Key, $"Unable to validate {key}'s type"));
validated.Add(new ErrorNode(node.GetKeyNode(key), $"Unable to validate {key}'s type"));
continue;
}
@@ -35,7 +35,7 @@ public sealed class NPCBlackboardSerializer : ITypeReader<NPCBlackboard, Mapping
if (!reflection.TryLooseGetType(typeString, out var type))
{
validated.Add(new ErrorNode(data.Key, $"Unable to find type for {typeString}"));
validated.Add(new ErrorNode(node.GetKeyNode(key), $"Unable to find type for {typeString}"));
continue;
}
@@ -60,7 +60,7 @@ public sealed class NPCBlackboardSerializer : ITypeReader<NPCBlackboard, Mapping
foreach (var data in node)
{
var key = data.Key.ToYamlNode().AsString();
var key = data.Key;
if (data.Value.Tag == null)
throw new NullReferenceException($"Found null tag for {key}");