Skip to content

Commit

Permalink
Fix unfortunate accident
Browse files Browse the repository at this point in the history
  • Loading branch information
GrimMaple committed Sep 18, 2024
1 parent 864c33b commit 9777142
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
3 changes: 2 additions & 1 deletion SpeedTool/Platform/Platform.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
1 change: 0 additions & 1 deletion SpeedTool/Platform/Run.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ public void Split()
{
Platform.SharedPlatform.ReloadRun();
timer.Reset();
controller = new SplitsController(category, null);
IsFinished = false;
return;
}
Expand Down
14 changes: 10 additions & 4 deletions SpeedTool/Splits/RunInfo.cs
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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; } = [];
}

0 comments on commit 9777142

Please sign in to comment.