More data object creation and test commands

This commit is contained in:
2025-11-30 23:19:18 -06:00
parent b40878a489
commit 678b762df5
8 changed files with 67 additions and 79 deletions

View File

@@ -29,7 +29,7 @@ public class Datapack
_path = Path.Combine(AppManager.DatapacksDirectory, Metadata.Id);
}
public void SavePack()
public void Save()
{
if (!Directory.Exists(_path))
@@ -48,12 +48,16 @@ public class Datapack
public void AddDataset(Dataset dataset)
{
dataset.Save();
dataset.Save($"{_path}/datasets/");
_datasetLookup.TryAdd(dataset.Metadata.Id, dataset);
}
public void AddTemplate(SzTemplate template)
{
_templateLookup.TryAdd(template.Id, template);
var success = _templateLookup.TryAdd(template.Id, template);
if (success)
{
File.WriteAllText($"{_path}/templates/{template.Id}.sztl", template.SztlText);
}
}
}