diff --git a/SpeedTool/Platform/Platform.cs b/SpeedTool/Platform/Platform.cs index a02947c..d819043 100644 --- a/SpeedTool/Platform/Platform.cs +++ b/SpeedTool/Platform/Platform.cs @@ -210,8 +210,9 @@ public void SaveRunAsPB(RunInfo run) { return JsonSerializer.Deserialize(File.ReadAllText(dst), typeof(RunInfo), SourceGeneratorContext.Default) as RunInfo; } - catch + catch(Exception ex) { + DebugLog.SharedInstance.Write(ex.Message); File.Delete(dst); return null; } diff --git a/SpeedTool/Platform/Run.cs b/SpeedTool/Platform/Run.cs index 33dbc50..47668b3 100644 --- a/SpeedTool/Platform/Run.cs +++ b/SpeedTool/Platform/Run.cs @@ -38,7 +38,6 @@ public void Split() { Platform.SharedPlatform.ReloadRun(); timer.Reset(); - controller = new SplitsController(category, null); IsFinished = false; return; } diff --git a/SpeedTool/Splits/RunInfo.cs b/SpeedTool/Splits/RunInfo.cs index afd502c..6a38a23 100644 --- a/SpeedTool/Splits/RunInfo.cs +++ b/SpeedTool/Splits/RunInfo.cs @@ -1,7 +1,11 @@ +using System.Text.Json.Serialization; +using SpeedTool.JSON; + namespace SpeedTool.Splits; public class RunInfo { + public RunInfo() { } public RunInfo(string name, string cat, TimeCollection times, SplitInfo[] infos) { CategoryName = cat; @@ -10,9 +14,11 @@ public RunInfo(string name, string cat, TimeCollection times, SplitInfo[] infos) Splits = infos; } - public string CategoryName { get; set; } - public string GameName { get; set; } - public TimeCollection TotalTimes { get; set; } + public string CategoryName { get; set; } = ""; + public string GameName { get; set; } = ""; + + [JsonConverter(typeof(TimeCollectionConverter))] + public TimeCollection TotalTimes { get; set; } = new(); - public SplitInfo[] Splits { get; set; } + public SplitInfo[] Splits { get; set; } = []; }