Working on data and sztl

This commit is contained in:
2025-11-30 19:32:36 -06:00
parent b1a43d038e
commit 27d3f0b452
16 changed files with 157 additions and 142 deletions

View File

@@ -1,35 +0,0 @@
using System.Collections.Generic;
using SessionZero.Data.Sztl;
namespace SessionZero.Data;
public class Dataset
{
public required DatasetMetadata Metadata { get; set; }
public Dictionary<string, SztlField> Fields { get; set; } = [];
public Dictionary<string, SztlFieldGroup> Groups { get; set; } = [];
/// <summary>
/// Returns an SzfField from a string path (use dot notation, eg 'stats.damage')
/// </summary>
/// <param name="fieldPath"></param>
/// <returns></returns>
public SztlField? GetField(string fieldPath)
{
var split = fieldPath.Split('.');
var fieldName = split[0];
if (split.Length == 1)
{
return Fields.GetValueOrDefault(fieldName);
}
else
{
// Todo: Recurse into Groups.Fields to find the path
}
return null;
}
}