Factories for templates and objects, Sztl parsing

This commit is contained in:
2025-11-30 21:16:33 -06:00
parent a892d982da
commit 069adb5ff5
10 changed files with 421 additions and 15 deletions

View File

@@ -0,0 +1,19 @@
using System;
using Tomlyn.Model;
namespace SessionZero.Data;
public class SzDataObjectTemplate : SzTemplate
{
public string DataType { get; set; }
public override void ParseAdditionalMetaData(TomlTable table)
{
if (!table.ContainsKey("metadata") || table["metadata"] is not TomlTable metadata) return;
if (metadata.TryGetValue("data_type", out var tempTypeVal))
{
DataType = tempTypeVal?.ToString() ?? throw new Exception("Template missing type metadata");
}
}
}