osu/osu.Game/Rulesets/Scoring/Score.cs

85 lines
2.3 KiB
C#
Raw Normal View History

// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
2016-11-29 06:41:48 +00:00
2017-03-15 05:06:05 +00:00
using System;
using System.Collections.Generic;
2017-03-15 05:06:05 +00:00
using Newtonsoft.Json;
2017-07-26 04:22:46 +00:00
using osu.Game.Beatmaps;
2017-04-18 07:05:58 +00:00
using osu.Game.Rulesets.Mods;
using osu.Game.Users;
2017-04-18 07:05:58 +00:00
using osu.Game.Rulesets.Replays;
2017-04-18 07:05:58 +00:00
namespace osu.Game.Rulesets.Scoring
2016-11-29 06:41:48 +00:00
{
public class Score
{
2017-03-13 21:34:43 +00:00
public ScoreRank Rank { get; set; }
2017-03-15 05:06:05 +00:00
[JsonProperty(@"score")]
2016-11-29 14:59:56 +00:00
public double TotalScore { get; set; }
2016-11-29 14:59:56 +00:00
public double Accuracy { get; set; }
2017-03-15 05:06:05 +00:00
public double Health { get; set; } = 1;
[JsonProperty(@"max_combo")]
2017-03-10 07:05:05 +00:00
public int MaxCombo { get; set; }
2017-03-10 07:05:05 +00:00
public int Combo { get; set; }
[JsonProperty(@"mods")]
protected string[] ModStrings { get; set; } //todo: parse to Mod objects
public RulesetInfo Ruleset { get; set; }
public Mod[] Mods { get; set; }
[JsonProperty(@"user")]
public User User;
2017-03-15 05:06:05 +00:00
[JsonProperty(@"replay_data")]
public Replay Replay;
2017-03-15 05:06:05 +00:00
2017-03-04 10:02:36 +00:00
public BeatmapInfo Beatmap;
2017-03-15 05:06:05 +00:00
[JsonProperty(@"score_id")]
public long OnlineScoreID;
[JsonProperty(@"created_at")]
2017-05-16 13:14:50 +00:00
public DateTimeOffset Date;
2017-03-15 05:06:05 +00:00
[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>();
2016-11-29 06:41:48 +00:00
}
}