More data object creation and test commands
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user