.
This commit is contained in:
@@ -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);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user