This commit is contained in:
2025-01-09 07:29:09 +03:00
parent d7678f19df
commit dca6c8920d

View File

@@ -38,6 +38,12 @@ public class ScoreTable
public static void Save(ScoreTable parTable, string parPath) public static void Save(ScoreTable parTable, string parPath)
{ {
var directory = Path.GetDirectoryName(parPath);
if (directory != null && !Directory.Exists(directory))
{
Directory.CreateDirectory(directory);
}
using var stream = File.Create(parPath); using var stream = File.Create(parPath);
JsonSerializer.Serialize(stream, parTable, OPTIONS); JsonSerializer.Serialize(stream, parTable, OPTIONS);
} }