mirror of
https://github.com/ppy/osu
synced 2024-12-14 10:57:41 +00:00
Add statistics storage to realm model
This commit is contained in:
parent
3da762e145
commit
638b3d9161
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user