1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-13 07:22:54 +08:00

Update score to read statistics from server.

Also brings some naming up-to-date.
This commit is contained in:
Dean Herbert 2017-04-20 18:54:35 +09:00
parent 84a8d8f00a
commit 008ca07b16
No known key found for this signature in database
GPG Key ID: 46D71BF4958ABB49

View File

@ -13,18 +13,16 @@ namespace osu.Game.Rulesets.Scoring
{
public class Score
{
[JsonProperty(@"rank")]
public ScoreRank Rank { get; set; }
[JsonProperty(@"score")]
public double TotalScore { get; set; }
[JsonProperty(@"accuracy")]
public double Accuracy { get; set; }
public double Health { get; set; } = 1;
[JsonProperty(@"combo")]
[JsonProperty(@"max_combo")]
public int MaxCombo { get; set; }
public int Combo { get; set; }
@ -50,6 +48,37 @@ namespace osu.Game.Rulesets.Scoring
[JsonProperty(@"created_at")]
public DateTime Date;
[JsonProperty(@"statistics")]
private Dictionary<string, dynamic> jsonStats
{
set
{
foreach (var kvp in value)
{
string key = kvp.Key;
switch (key)
{
case @"count_300":
key = @"300";
break;
case @"count_100":
key = @"100";
break;
case @"count_50":
key = @"50";
break;
case @"count_miss":
key = @"x";
break;
default:
continue;
}
Statistics.Add(key, kvp.Value);
}
}
}
public Dictionary<string, dynamic> Statistics = new Dictionary<string, dynamic>();
}
}