Ready for the first beta release. #105

Merged
That-One-Nerd merged 41 commits from main-canary into main 2023-05-18 13:05:42 -04:00
Showing only changes of commit ab0453e0ab - Show all commits

View File

@ -165,20 +165,28 @@ public static class VkvConvert
foreach (FieldInfo field in validFields) foreach (FieldInfo field in validFields)
{ {
// TODO: check if the node tree has that field. string name = field.Name;
// TODO: VkvNode? subNode = tree[name];
// parsables if (subNode is null) continue;
// enums
// casting object? result = FromNodeTree(field.FieldType, subNode, options);
// sub-conversion if (result is null) continue;
field.SetValue(instance, result);
} }
foreach (PropertyInfo prop in validProperties) foreach (PropertyInfo prop in validProperties)
{ {
// TODO: check if the node tree has that field. string name = prop.Name;
VkvNode? subNode = tree[name];
if (subNode is null) continue;
object? result = FromNodeTree(prop.PropertyType, subNode, options);
if (result is null) continue;
prop.SetValue(instance, result);
} }
return null; return instance;
} }
else throw new VkvSerializationException("Unknown VKV node type."); else throw new VkvSerializationException("Unknown VKV node type.");
} }