From 638b3d91610dd3cf548f859ee704f9963aa5bc3f Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 6 Dec 2021 15:32:02 +0900 Subject: [PATCH] Add statistics storage to realm model --- osu.Game/Scoring/ScoreInfo.cs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/osu.Game/Scoring/ScoreInfo.cs b/osu.Game/Scoring/ScoreInfo.cs index 0c097d1294..1938271989 100644 --- a/osu.Game/Scoring/ScoreInfo.cs +++ b/osu.Game/Scoring/ScoreInfo.cs @@ -51,6 +51,22 @@ namespace osu.Game.Scoring public RealmRuleset Ruleset { get; set; } = null!; + [Ignored] + public Dictionary Statistics + { + get + { + if (string.IsNullOrEmpty(StatisticsJson)) + return new Dictionary(); + + return JsonConvert.DeserializeObject>(StatisticsJson) ?? new Dictionary(); + } + set => JsonConvert.SerializeObject(StatisticsJson); + } + + [MapTo("Statistics")] + public string StatisticsJson { get; set; } = null!; + public ScoreRank Rank { get => (ScoreRank)RankInt;