1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 06:52:55 +08:00

Add statistics storage to realm model

This commit is contained in:
Dean Herbert 2021-12-06 15:32:02 +09:00
parent 3da762e145
commit 638b3d9161

View File

@ -51,6 +51,22 @@ namespace osu.Game.Scoring
public RealmRuleset Ruleset { get; set; } = null!;
[Ignored]
public Dictionary<HitResult, int> Statistics
{
get
{
if (string.IsNullOrEmpty(StatisticsJson))
return new Dictionary<HitResult, int>();
return JsonConvert.DeserializeObject<Dictionary<HitResult, int>>(StatisticsJson) ?? new Dictionary<HitResult, int>();
}
set => JsonConvert.SerializeObject(StatisticsJson);
}
[MapTo("Statistics")]
public string StatisticsJson { get; set; } = null!;
public ScoreRank Rank
{
get => (ScoreRank)RankInt;