mirror of
https://github.com/ppy/osu
synced 2024-12-23 23:33:36 +00:00
Score -> ScoreInfo
This commit is contained in:
parent
5b409a5ae5
commit
219929eb47
@ -12,9 +12,9 @@ namespace osu.Game.Rulesets.Catch.Mods
|
||||
{
|
||||
public class CatchModAutoplay : ModAutoplay<CatchHitObject>
|
||||
{
|
||||
protected override Score CreateReplayScore(Beatmap<CatchHitObject> beatmap)
|
||||
protected override ScoreInfo CreateReplayScore(Beatmap<CatchHitObject> beatmap)
|
||||
{
|
||||
return new Score
|
||||
return new ScoreInfo
|
||||
{
|
||||
User = new User { Username = "osu!salad!" },
|
||||
Replay = new CatchAutoGenerator(beatmap).Generate(),
|
||||
|
@ -28,21 +28,21 @@ namespace osu.Game.Rulesets.Mania.Difficulty
|
||||
private int countMeh;
|
||||
private int countMiss;
|
||||
|
||||
public ManiaPerformanceCalculator(Ruleset ruleset, WorkingBeatmap beatmap, Score score)
|
||||
: base(ruleset, beatmap, score)
|
||||
public ManiaPerformanceCalculator(Ruleset ruleset, WorkingBeatmap beatmap, ScoreInfo scoreInfo)
|
||||
: base(ruleset, beatmap, scoreInfo)
|
||||
{
|
||||
}
|
||||
|
||||
public override double Calculate(Dictionary<string, double> categoryDifficulty = null)
|
||||
{
|
||||
mods = Score.Mods;
|
||||
scaledScore = Score.TotalScore;
|
||||
countPerfect = Convert.ToInt32(Score.Statistics[HitResult.Perfect]);
|
||||
countGreat = Convert.ToInt32(Score.Statistics[HitResult.Great]);
|
||||
countGood = Convert.ToInt32(Score.Statistics[HitResult.Good]);
|
||||
countOk = Convert.ToInt32(Score.Statistics[HitResult.Ok]);
|
||||
countMeh = Convert.ToInt32(Score.Statistics[HitResult.Meh]);
|
||||
countMiss = Convert.ToInt32(Score.Statistics[HitResult.Miss]);
|
||||
mods = ScoreInfo.Mods;
|
||||
scaledScore = ScoreInfo.TotalScore;
|
||||
countPerfect = Convert.ToInt32(ScoreInfo.Statistics[HitResult.Perfect]);
|
||||
countGreat = Convert.ToInt32(ScoreInfo.Statistics[HitResult.Great]);
|
||||
countGood = Convert.ToInt32(ScoreInfo.Statistics[HitResult.Good]);
|
||||
countOk = Convert.ToInt32(ScoreInfo.Statistics[HitResult.Ok]);
|
||||
countMeh = Convert.ToInt32(ScoreInfo.Statistics[HitResult.Meh]);
|
||||
countMiss = Convert.ToInt32(ScoreInfo.Statistics[HitResult.Miss]);
|
||||
|
||||
if (mods.Any(m => !m.Ranked))
|
||||
return 0;
|
||||
|
@ -32,7 +32,7 @@ namespace osu.Game.Rulesets.Mania
|
||||
{
|
||||
public override RulesetContainer CreateRulesetContainerWith(WorkingBeatmap beatmap) => new ManiaRulesetContainer(this, beatmap);
|
||||
public override IBeatmapConverter CreateBeatmapConverter(IBeatmap beatmap) => new ManiaBeatmapConverter(beatmap);
|
||||
public override PerformanceCalculator CreatePerformanceCalculator(WorkingBeatmap beatmap, Score score) => new ManiaPerformanceCalculator(this, beatmap, score);
|
||||
public override PerformanceCalculator CreatePerformanceCalculator(WorkingBeatmap beatmap, ScoreInfo scoreInfo) => new ManiaPerformanceCalculator(this, beatmap, scoreInfo);
|
||||
|
||||
public override HitObjectComposer CreateHitObjectComposer() => new ManiaHitObjectComposer(this);
|
||||
|
||||
|
@ -13,9 +13,9 @@ namespace osu.Game.Rulesets.Mania.Mods
|
||||
{
|
||||
public class ManiaModAutoplay : ModAutoplay<ManiaHitObject>
|
||||
{
|
||||
protected override Score CreateReplayScore(Beatmap<ManiaHitObject> beatmap)
|
||||
protected override ScoreInfo CreateReplayScore(Beatmap<ManiaHitObject> beatmap)
|
||||
{
|
||||
return new Score
|
||||
return new ScoreInfo
|
||||
{
|
||||
User = new User { Username = "osu!topus!" },
|
||||
Replay = new ManiaAutoGenerator((ManiaBeatmap)beatmap).Generate(),
|
||||
|
@ -30,8 +30,8 @@ namespace osu.Game.Rulesets.Osu.Difficulty
|
||||
private int countMeh;
|
||||
private int countMiss;
|
||||
|
||||
public OsuPerformanceCalculator(Ruleset ruleset, WorkingBeatmap beatmap, Score score)
|
||||
: base(ruleset, beatmap, score)
|
||||
public OsuPerformanceCalculator(Ruleset ruleset, WorkingBeatmap beatmap, ScoreInfo scoreInfo)
|
||||
: base(ruleset, beatmap, scoreInfo)
|
||||
{
|
||||
countHitCircles = Beatmap.HitObjects.Count(h => h is HitCircle);
|
||||
|
||||
@ -42,13 +42,13 @@ namespace osu.Game.Rulesets.Osu.Difficulty
|
||||
|
||||
public override double Calculate(Dictionary<string, double> categoryRatings = null)
|
||||
{
|
||||
mods = Score.Mods;
|
||||
accuracy = Score.Accuracy;
|
||||
scoreMaxCombo = Score.MaxCombo;
|
||||
countGreat = Convert.ToInt32(Score.Statistics[HitResult.Great]);
|
||||
countGood = Convert.ToInt32(Score.Statistics[HitResult.Good]);
|
||||
countMeh = Convert.ToInt32(Score.Statistics[HitResult.Meh]);
|
||||
countMiss = Convert.ToInt32(Score.Statistics[HitResult.Miss]);
|
||||
mods = ScoreInfo.Mods;
|
||||
accuracy = ScoreInfo.Accuracy;
|
||||
scoreMaxCombo = ScoreInfo.MaxCombo;
|
||||
countGreat = Convert.ToInt32(ScoreInfo.Statistics[HitResult.Great]);
|
||||
countGood = Convert.ToInt32(ScoreInfo.Statistics[HitResult.Good]);
|
||||
countMeh = Convert.ToInt32(ScoreInfo.Statistics[HitResult.Meh]);
|
||||
countMiss = Convert.ToInt32(ScoreInfo.Statistics[HitResult.Miss]);
|
||||
|
||||
// Don't count scores made with supposedly unranked mods
|
||||
if (mods.Any(m => !m.Ranked))
|
||||
|
@ -15,9 +15,9 @@ namespace osu.Game.Rulesets.Osu.Mods
|
||||
{
|
||||
public override Type[] IncompatibleMods => base.IncompatibleMods.Append(typeof(OsuModAutopilot)).Append(typeof(OsuModSpunOut)).ToArray();
|
||||
|
||||
protected override Score CreateReplayScore(Beatmap<OsuHitObject> beatmap)
|
||||
protected override ScoreInfo CreateReplayScore(Beatmap<OsuHitObject> beatmap)
|
||||
{
|
||||
return new Score
|
||||
return new ScoreInfo
|
||||
{
|
||||
Replay = new OsuAutoGenerator(beatmap).Generate()
|
||||
};
|
||||
|
@ -131,7 +131,7 @@ namespace osu.Game.Rulesets.Osu
|
||||
|
||||
public override DifficultyCalculator CreateDifficultyCalculator(WorkingBeatmap beatmap) => new OsuDifficultyCalculator(this, beatmap);
|
||||
|
||||
public override PerformanceCalculator CreatePerformanceCalculator(WorkingBeatmap beatmap, Score score) => new OsuPerformanceCalculator(this, beatmap, score);
|
||||
public override PerformanceCalculator CreatePerformanceCalculator(WorkingBeatmap beatmap, ScoreInfo scoreInfo) => new OsuPerformanceCalculator(this, beatmap, scoreInfo);
|
||||
|
||||
public override HitObjectComposer CreateHitObjectComposer() => new OsuHitObjectComposer(this);
|
||||
|
||||
|
@ -40,14 +40,14 @@ namespace osu.Game.Rulesets.Osu.Scoring
|
||||
comboResultCounts.Clear();
|
||||
}
|
||||
|
||||
public override void PopulateScore(Score score)
|
||||
public override void PopulateScore(ScoreInfo scoreInfo)
|
||||
{
|
||||
base.PopulateScore(score);
|
||||
base.PopulateScore(scoreInfo);
|
||||
|
||||
score.Statistics[HitResult.Great] = scoreResultCounts.GetOrDefault(HitResult.Great);
|
||||
score.Statistics[HitResult.Good] = scoreResultCounts.GetOrDefault(HitResult.Good);
|
||||
score.Statistics[HitResult.Meh] = scoreResultCounts.GetOrDefault(HitResult.Meh);
|
||||
score.Statistics[HitResult.Miss] = scoreResultCounts.GetOrDefault(HitResult.Miss);
|
||||
scoreInfo.Statistics[HitResult.Great] = scoreResultCounts.GetOrDefault(HitResult.Great);
|
||||
scoreInfo.Statistics[HitResult.Good] = scoreResultCounts.GetOrDefault(HitResult.Good);
|
||||
scoreInfo.Statistics[HitResult.Meh] = scoreResultCounts.GetOrDefault(HitResult.Meh);
|
||||
scoreInfo.Statistics[HitResult.Miss] = scoreResultCounts.GetOrDefault(HitResult.Miss);
|
||||
}
|
||||
|
||||
private const double harshness = 0.01;
|
||||
|
@ -23,18 +23,18 @@ namespace osu.Game.Rulesets.Taiko.Difficulty
|
||||
private int countMeh;
|
||||
private int countMiss;
|
||||
|
||||
public TaikoPerformanceCalculator(Ruleset ruleset, WorkingBeatmap beatmap, Score score)
|
||||
: base(ruleset, beatmap, score)
|
||||
public TaikoPerformanceCalculator(Ruleset ruleset, WorkingBeatmap beatmap, ScoreInfo scoreInfo)
|
||||
: base(ruleset, beatmap, scoreInfo)
|
||||
{
|
||||
}
|
||||
|
||||
public override double Calculate(Dictionary<string, double> categoryDifficulty = null)
|
||||
{
|
||||
mods = Score.Mods;
|
||||
countGreat = Convert.ToInt32(Score.Statistics[HitResult.Great]);
|
||||
countGood = Convert.ToInt32(Score.Statistics[HitResult.Good]);
|
||||
countMeh = Convert.ToInt32(Score.Statistics[HitResult.Meh]);
|
||||
countMiss = Convert.ToInt32(Score.Statistics[HitResult.Miss]);
|
||||
mods = ScoreInfo.Mods;
|
||||
countGreat = Convert.ToInt32(ScoreInfo.Statistics[HitResult.Great]);
|
||||
countGood = Convert.ToInt32(ScoreInfo.Statistics[HitResult.Good]);
|
||||
countMeh = Convert.ToInt32(ScoreInfo.Statistics[HitResult.Meh]);
|
||||
countMiss = Convert.ToInt32(ScoreInfo.Statistics[HitResult.Miss]);
|
||||
|
||||
// Don't count scores made with supposedly unranked mods
|
||||
if (mods.Any(m => !m.Ranked))
|
||||
@ -79,7 +79,7 @@ namespace osu.Game.Rulesets.Taiko.Difficulty
|
||||
|
||||
// Combo scaling
|
||||
if (Attributes.MaxCombo > 0)
|
||||
strainValue *= Math.Min(Math.Pow(Score.MaxCombo, 0.5) / Math.Pow(Attributes.MaxCombo, 0.5), 1.0);
|
||||
strainValue *= Math.Min(Math.Pow(ScoreInfo.MaxCombo, 0.5) / Math.Pow(Attributes.MaxCombo, 0.5), 1.0);
|
||||
|
||||
if (mods.Any(m => m is ModHidden))
|
||||
strainValue *= 1.025;
|
||||
@ -89,7 +89,7 @@ namespace osu.Game.Rulesets.Taiko.Difficulty
|
||||
strainValue *= 1.05 * lengthBonus;
|
||||
|
||||
// Scale the speed value with accuracy _slightly_
|
||||
return strainValue * Score.Accuracy;
|
||||
return strainValue * ScoreInfo.Accuracy;
|
||||
}
|
||||
|
||||
private double computeAccuracyValue()
|
||||
@ -99,7 +99,7 @@ namespace osu.Game.Rulesets.Taiko.Difficulty
|
||||
|
||||
// Lots of arbitrary values from testing.
|
||||
// Considering to use derivation from perfect accuracy in a probabilistic manner - assume normal distribution
|
||||
double accValue = Math.Pow(150.0 / Attributes.GreatHitWindow, 1.1) * Math.Pow(Score.Accuracy, 15) * 22.0;
|
||||
double accValue = Math.Pow(150.0 / Attributes.GreatHitWindow, 1.1) * Math.Pow(ScoreInfo.Accuracy, 15) * 22.0;
|
||||
|
||||
// Bonus for many hitcircles - it's harder to keep good accuracy up for longer
|
||||
return accValue * Math.Min(1.15, Math.Pow(totalHits / 1500.0, 0.3));
|
||||
|
@ -12,9 +12,9 @@ namespace osu.Game.Rulesets.Taiko.Mods
|
||||
{
|
||||
public class TaikoModAutoplay : ModAutoplay<TaikoHitObject>
|
||||
{
|
||||
protected override Score CreateReplayScore(Beatmap<TaikoHitObject> beatmap)
|
||||
protected override ScoreInfo CreateReplayScore(Beatmap<TaikoHitObject> beatmap)
|
||||
{
|
||||
return new Score
|
||||
return new ScoreInfo
|
||||
{
|
||||
User = new User { Username = "mekkadosu!" },
|
||||
Replay = new TaikoAutoGenerator(beatmap).Generate(),
|
||||
|
@ -112,7 +112,7 @@ namespace osu.Game.Rulesets.Taiko
|
||||
|
||||
public override DifficultyCalculator CreateDifficultyCalculator(WorkingBeatmap beatmap) => new TaikoDifficultyCalculator(this, beatmap);
|
||||
|
||||
public override PerformanceCalculator CreatePerformanceCalculator(WorkingBeatmap beatmap, Score score) => new TaikoPerformanceCalculator(this, beatmap, score);
|
||||
public override PerformanceCalculator CreatePerformanceCalculator(WorkingBeatmap beatmap, ScoreInfo scoreInfo) => new TaikoPerformanceCalculator(this, beatmap, scoreInfo);
|
||||
|
||||
public override int? LegacyID => 1;
|
||||
|
||||
|
@ -23,9 +23,9 @@ namespace osu.Game.Tests.Visual
|
||||
[System.ComponentModel.Description("in BeatmapOverlay")]
|
||||
public class TestCaseBeatmapScoresContainer : OsuTestCase
|
||||
{
|
||||
private readonly IEnumerable<APIScore> scores;
|
||||
private readonly IEnumerable<APIScore> anotherScores;
|
||||
private readonly APIScore topScore;
|
||||
private readonly IEnumerable<APIScoreInfo> scores;
|
||||
private readonly IEnumerable<APIScoreInfo> anotherScores;
|
||||
private readonly APIScoreInfo topScoreInfo;
|
||||
private readonly Box background;
|
||||
|
||||
public TestCaseBeatmapScoresContainer()
|
||||
@ -49,7 +49,7 @@ namespace osu.Game.Tests.Visual
|
||||
|
||||
AddStep("scores pack 1", () => scoresContainer.Scores = scores);
|
||||
AddStep("scores pack 2", () => scoresContainer.Scores = anotherScores);
|
||||
AddStep("only top score", () => scoresContainer.Scores = new[] { topScore });
|
||||
AddStep("only top score", () => scoresContainer.Scores = new[] { topScoreInfo });
|
||||
AddStep("remove scores", () => scoresContainer.Scores = null);
|
||||
AddStep("resize to big", () => container.ResizeWidthTo(1, 300));
|
||||
AddStep("resize to normal", () => container.ResizeWidthTo(0.8f, 300));
|
||||
@ -58,7 +58,7 @@ namespace osu.Game.Tests.Visual
|
||||
|
||||
scores = new[]
|
||||
{
|
||||
new APIScore
|
||||
new APIScoreInfo
|
||||
{
|
||||
User = new User
|
||||
{
|
||||
@ -81,7 +81,7 @@ namespace osu.Game.Tests.Visual
|
||||
TotalScore = 1234567890,
|
||||
Accuracy = 1,
|
||||
},
|
||||
new APIScore
|
||||
new APIScoreInfo
|
||||
{
|
||||
User = new User
|
||||
{
|
||||
@ -103,7 +103,7 @@ namespace osu.Game.Tests.Visual
|
||||
TotalScore = 1234789,
|
||||
Accuracy = 0.9997,
|
||||
},
|
||||
new APIScore
|
||||
new APIScoreInfo
|
||||
{
|
||||
User = new User
|
||||
{
|
||||
@ -124,7 +124,7 @@ namespace osu.Game.Tests.Visual
|
||||
TotalScore = 12345678,
|
||||
Accuracy = 0.9854,
|
||||
},
|
||||
new APIScore
|
||||
new APIScoreInfo
|
||||
{
|
||||
User = new User
|
||||
{
|
||||
@ -144,7 +144,7 @@ namespace osu.Game.Tests.Visual
|
||||
TotalScore = 1234567,
|
||||
Accuracy = 0.8765,
|
||||
},
|
||||
new APIScore
|
||||
new APIScoreInfo
|
||||
{
|
||||
User = new User
|
||||
{
|
||||
@ -170,7 +170,7 @@ namespace osu.Game.Tests.Visual
|
||||
|
||||
anotherScores = new[]
|
||||
{
|
||||
new APIScore
|
||||
new APIScoreInfo
|
||||
{
|
||||
User = new User
|
||||
{
|
||||
@ -192,7 +192,7 @@ namespace osu.Game.Tests.Visual
|
||||
TotalScore = 1234789,
|
||||
Accuracy = 0.9997,
|
||||
},
|
||||
new APIScore
|
||||
new APIScoreInfo
|
||||
{
|
||||
User = new User
|
||||
{
|
||||
@ -215,7 +215,7 @@ namespace osu.Game.Tests.Visual
|
||||
TotalScore = 1234567890,
|
||||
Accuracy = 1,
|
||||
},
|
||||
new APIScore
|
||||
new APIScoreInfo
|
||||
{
|
||||
User = new User
|
||||
{
|
||||
@ -231,7 +231,7 @@ namespace osu.Game.Tests.Visual
|
||||
TotalScore = 123456,
|
||||
Accuracy = 0.6543,
|
||||
},
|
||||
new APIScore
|
||||
new APIScoreInfo
|
||||
{
|
||||
User = new User
|
||||
{
|
||||
@ -252,7 +252,7 @@ namespace osu.Game.Tests.Visual
|
||||
TotalScore = 12345678,
|
||||
Accuracy = 0.9854,
|
||||
},
|
||||
new APIScore
|
||||
new APIScoreInfo
|
||||
{
|
||||
User = new User
|
||||
{
|
||||
@ -280,7 +280,7 @@ namespace osu.Game.Tests.Visual
|
||||
s.Statistics.Add(HitResult.Meh, RNG.Next(2000));
|
||||
}
|
||||
|
||||
topScore = new APIScore
|
||||
topScoreInfo = new APIScoreInfo
|
||||
{
|
||||
User = new User
|
||||
{
|
||||
@ -302,9 +302,9 @@ namespace osu.Game.Tests.Visual
|
||||
TotalScore = 987654321,
|
||||
Accuracy = 0.8487,
|
||||
};
|
||||
topScore.Statistics.Add(HitResult.Great, RNG.Next(2000));
|
||||
topScore.Statistics.Add(HitResult.Good, RNG.Next(2000));
|
||||
topScore.Statistics.Add(HitResult.Meh, RNG.Next(2000));
|
||||
topScoreInfo.Statistics.Add(HitResult.Great, RNG.Next(2000));
|
||||
topScoreInfo.Statistics.Add(HitResult.Good, RNG.Next(2000));
|
||||
topScoreInfo.Statistics.Add(HitResult.Meh, RNG.Next(2000));
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
|
@ -58,7 +58,7 @@ namespace osu.Game.Tests.Visual
|
||||
{
|
||||
var scores = new[]
|
||||
{
|
||||
new Score
|
||||
new ScoreInfo
|
||||
{
|
||||
Rank = ScoreRank.XH,
|
||||
Accuracy = 1,
|
||||
@ -76,7 +76,7 @@ namespace osu.Game.Tests.Visual
|
||||
},
|
||||
},
|
||||
},
|
||||
new Score
|
||||
new ScoreInfo
|
||||
{
|
||||
Rank = ScoreRank.X,
|
||||
Accuracy = 1,
|
||||
@ -94,7 +94,7 @@ namespace osu.Game.Tests.Visual
|
||||
},
|
||||
},
|
||||
},
|
||||
new Score
|
||||
new ScoreInfo
|
||||
{
|
||||
Rank = ScoreRank.SH,
|
||||
Accuracy = 1,
|
||||
@ -112,7 +112,7 @@ namespace osu.Game.Tests.Visual
|
||||
},
|
||||
},
|
||||
},
|
||||
new Score
|
||||
new ScoreInfo
|
||||
{
|
||||
Rank = ScoreRank.S,
|
||||
Accuracy = 1,
|
||||
@ -130,7 +130,7 @@ namespace osu.Game.Tests.Visual
|
||||
},
|
||||
},
|
||||
},
|
||||
new Score
|
||||
new ScoreInfo
|
||||
{
|
||||
Rank = ScoreRank.A,
|
||||
Accuracy = 1,
|
||||
@ -148,7 +148,7 @@ namespace osu.Game.Tests.Visual
|
||||
},
|
||||
},
|
||||
},
|
||||
new Score
|
||||
new ScoreInfo
|
||||
{
|
||||
Rank = ScoreRank.B,
|
||||
Accuracy = 0.9826,
|
||||
@ -166,7 +166,7 @@ namespace osu.Game.Tests.Visual
|
||||
},
|
||||
},
|
||||
},
|
||||
new Score
|
||||
new ScoreInfo
|
||||
{
|
||||
Rank = ScoreRank.C,
|
||||
Accuracy = 0.9654,
|
||||
@ -184,7 +184,7 @@ namespace osu.Game.Tests.Visual
|
||||
},
|
||||
},
|
||||
},
|
||||
new Score
|
||||
new ScoreInfo
|
||||
{
|
||||
Rank = ScoreRank.F,
|
||||
Accuracy = 0.6025,
|
||||
@ -202,7 +202,7 @@ namespace osu.Game.Tests.Visual
|
||||
},
|
||||
},
|
||||
},
|
||||
new Score
|
||||
new ScoreInfo
|
||||
{
|
||||
Rank = ScoreRank.F,
|
||||
Accuracy = 0.5140,
|
||||
@ -220,7 +220,7 @@ namespace osu.Game.Tests.Visual
|
||||
},
|
||||
},
|
||||
},
|
||||
new Score
|
||||
new ScoreInfo
|
||||
{
|
||||
Rank = ScoreRank.F,
|
||||
Accuracy = 0.4222,
|
||||
|
@ -20,7 +20,7 @@ namespace osu.Game.Tests.Visual
|
||||
|
||||
public override IReadOnlyList<Type> RequiredTypes => new[]
|
||||
{
|
||||
typeof(Score),
|
||||
typeof(ScoreInfo),
|
||||
typeof(Results),
|
||||
typeof(ResultsPage),
|
||||
typeof(ResultsPageScore),
|
||||
@ -41,7 +41,7 @@ namespace osu.Game.Tests.Visual
|
||||
if (beatmapInfo != null)
|
||||
Beatmap.Value = beatmaps.GetWorkingBeatmap(beatmapInfo);
|
||||
|
||||
Add(new Results(new Score
|
||||
Add(new Results(new ScoreInfo
|
||||
{
|
||||
TotalScore = 2845370,
|
||||
Accuracy = 0.98,
|
||||
|
@ -28,7 +28,7 @@ namespace osu.Game.Database
|
||||
public DbSet<FileInfo> FileInfo { get; set; }
|
||||
public DbSet<RulesetInfo> RulesetInfo { get; set; }
|
||||
public DbSet<SkinInfo> SkinInfo { get; set; }
|
||||
public DbSet<Score> ScoreInfo { get; set; }
|
||||
public DbSet<ScoreInfo> ScoreInfo { get; set; }
|
||||
|
||||
private readonly string connectionString;
|
||||
|
||||
|
@ -33,7 +33,7 @@ namespace osu.Game.Online.API.Requests
|
||||
|
||||
private void onSuccess(APIScores r)
|
||||
{
|
||||
foreach (APIScore score in r.Scores)
|
||||
foreach (APIScoreInfo score in r.Scores)
|
||||
score.ApplyBeatmap(beatmap);
|
||||
}
|
||||
|
||||
|
@ -6,7 +6,7 @@ using osu.Game.Online.API.Requests.Responses;
|
||||
|
||||
namespace osu.Game.Online.API.Requests
|
||||
{
|
||||
public class GetUserScoresRequest : APIRequest<List<APIScore>>
|
||||
public class GetUserScoresRequest : APIRequest<List<APIScoreInfo>>
|
||||
{
|
||||
private readonly long userId;
|
||||
private readonly ScoreType type;
|
||||
|
@ -14,7 +14,7 @@ using osu.Game.Users;
|
||||
|
||||
namespace osu.Game.Online.API.Requests.Responses
|
||||
{
|
||||
public class APIScore : Score
|
||||
public class APIScoreInfo : ScoreInfo
|
||||
{
|
||||
[JsonProperty(@"score")]
|
||||
private double totalScore
|
@ -9,6 +9,6 @@ namespace osu.Game.Online.API.Requests.Responses
|
||||
public class APIScores
|
||||
{
|
||||
[JsonProperty(@"scores")]
|
||||
public IEnumerable<APIScore> Scores;
|
||||
public IEnumerable<APIScoreInfo> Scores;
|
||||
}
|
||||
}
|
||||
|
@ -248,7 +248,7 @@ namespace osu.Game
|
||||
/// <param name="beatmapId">The beatmap to show.</param>
|
||||
public void ShowBeatmap(int beatmapId) => beatmapSetOverlay.FetchAndShowBeatmap(beatmapId);
|
||||
|
||||
protected void LoadScore(Score score)
|
||||
protected void LoadScore(ScoreInfo scoreInfo)
|
||||
{
|
||||
scoreLoad?.Cancel();
|
||||
|
||||
@ -256,18 +256,18 @@ namespace osu.Game
|
||||
|
||||
if (menu == null)
|
||||
{
|
||||
scoreLoad = Schedule(() => LoadScore(score));
|
||||
scoreLoad = Schedule(() => LoadScore(scoreInfo));
|
||||
return;
|
||||
}
|
||||
|
||||
if (!menu.IsCurrentScreen)
|
||||
{
|
||||
menu.MakeCurrent();
|
||||
this.Delay(500).Schedule(() => LoadScore(score), out scoreLoad);
|
||||
this.Delay(500).Schedule(() => LoadScore(scoreInfo), out scoreLoad);
|
||||
return;
|
||||
}
|
||||
|
||||
if (score.BeatmapInfo == null)
|
||||
if (scoreInfo.BeatmapInfo == null)
|
||||
{
|
||||
notifications.Post(new SimpleNotification
|
||||
{
|
||||
@ -277,12 +277,12 @@ namespace osu.Game
|
||||
return;
|
||||
}
|
||||
|
||||
ruleset.Value = score.Ruleset;
|
||||
ruleset.Value = scoreInfo.Ruleset;
|
||||
|
||||
Beatmap.Value = BeatmapManager.GetWorkingBeatmap(score.BeatmapInfo);
|
||||
Beatmap.Value.Mods.Value = score.Mods;
|
||||
Beatmap.Value = BeatmapManager.GetWorkingBeatmap(scoreInfo.BeatmapInfo);
|
||||
Beatmap.Value.Mods.Value = scoreInfo.Mods;
|
||||
|
||||
menu.Push(new PlayerLoader(new ReplayPlayer(score.Replay)));
|
||||
menu.Push(new PlayerLoader(new ReplayPlayer(scoreInfo.Replay)));
|
||||
}
|
||||
|
||||
protected override void Dispose(bool isDisposing)
|
||||
|
@ -26,7 +26,7 @@ namespace osu.Game.Overlays.BeatmapSet.Scores
|
||||
|
||||
private readonly Box background;
|
||||
|
||||
public DrawableScore(int index, APIScore score)
|
||||
public DrawableScore(int index, APIScoreInfo scoreInfo)
|
||||
{
|
||||
ScoreModsContainer modsContainer;
|
||||
|
||||
@ -49,7 +49,7 @@ namespace osu.Game.Overlays.BeatmapSet.Scores
|
||||
Font = @"Exo2.0-RegularItalic",
|
||||
Margin = new MarginPadding { Left = side_margin }
|
||||
},
|
||||
new DrawableFlag(score.User.Country)
|
||||
new DrawableFlag(scoreInfo.User.Country)
|
||||
{
|
||||
Anchor = Anchor.CentreLeft,
|
||||
Origin = Anchor.CentreLeft,
|
||||
@ -60,7 +60,7 @@ namespace osu.Game.Overlays.BeatmapSet.Scores
|
||||
{
|
||||
Anchor = Anchor.CentreLeft,
|
||||
Origin = Anchor.CentreLeft,
|
||||
User = score.User,
|
||||
User = scoreInfo.User,
|
||||
Margin = new MarginPadding { Left = 100 }
|
||||
},
|
||||
modsContainer = new ScoreModsContainer
|
||||
@ -73,7 +73,7 @@ namespace osu.Game.Overlays.BeatmapSet.Scores
|
||||
RelativePositionAxes = Axes.X,
|
||||
X = 0.42f
|
||||
},
|
||||
new DrawableRank(score.Rank)
|
||||
new DrawableRank(scoreInfo.Rank)
|
||||
{
|
||||
Anchor = Anchor.CentreLeft,
|
||||
Origin = Anchor.CentreLeft,
|
||||
@ -86,7 +86,7 @@ namespace osu.Game.Overlays.BeatmapSet.Scores
|
||||
{
|
||||
Anchor = Anchor.CentreLeft,
|
||||
Origin = Anchor.CentreRight,
|
||||
Text = $@"{score.TotalScore:N0}",
|
||||
Text = $@"{scoreInfo.TotalScore:N0}",
|
||||
Font = @"Venera",
|
||||
RelativePositionAxes = Axes.X,
|
||||
X = 0.75f,
|
||||
@ -96,7 +96,7 @@ namespace osu.Game.Overlays.BeatmapSet.Scores
|
||||
{
|
||||
Anchor = Anchor.CentreLeft,
|
||||
Origin = Anchor.CentreRight,
|
||||
Text = $@"{score.Accuracy:P2}",
|
||||
Text = $@"{scoreInfo.Accuracy:P2}",
|
||||
Font = @"Exo2.0-RegularItalic",
|
||||
RelativePositionAxes = Axes.X,
|
||||
X = 0.85f
|
||||
@ -105,13 +105,13 @@ namespace osu.Game.Overlays.BeatmapSet.Scores
|
||||
{
|
||||
Anchor = Anchor.CentreRight,
|
||||
Origin = Anchor.CentreRight,
|
||||
Text = $"{score.Statistics[HitResult.Great]}/{score.Statistics[HitResult.Good]}/{score.Statistics[HitResult.Meh]}",
|
||||
Text = $"{scoreInfo.Statistics[HitResult.Great]}/{scoreInfo.Statistics[HitResult.Good]}/{scoreInfo.Statistics[HitResult.Meh]}",
|
||||
Font = @"Exo2.0-RegularItalic",
|
||||
Margin = new MarginPadding { Right = side_margin }
|
||||
},
|
||||
};
|
||||
|
||||
foreach (Mod mod in score.Mods)
|
||||
foreach (Mod mod in scoreInfo.Mods)
|
||||
modsContainer.Add(new ModIcon(mod)
|
||||
{
|
||||
AutoSizeAxes = Axes.Both,
|
||||
|
@ -43,26 +43,26 @@ namespace osu.Game.Overlays.BeatmapSet.Scores
|
||||
private readonly InfoColumn statistics;
|
||||
private readonly ScoreModsContainer modsContainer;
|
||||
|
||||
private APIScore score;
|
||||
public APIScore Score
|
||||
private APIScoreInfo scoreInfo;
|
||||
public APIScoreInfo ScoreInfo
|
||||
{
|
||||
get { return score; }
|
||||
get { return scoreInfo; }
|
||||
set
|
||||
{
|
||||
if (score == value) return;
|
||||
score = value;
|
||||
if (scoreInfo == value) return;
|
||||
scoreInfo = value;
|
||||
|
||||
avatar.User = username.User = score.User;
|
||||
flag.Country = score.User.Country;
|
||||
date.Text = $@"achieved {score.Date:MMM d, yyyy}";
|
||||
rank.UpdateRank(score.Rank);
|
||||
avatar.User = username.User = scoreInfo.User;
|
||||
flag.Country = scoreInfo.User.Country;
|
||||
date.Text = $@"achieved {scoreInfo.Date:MMM d, yyyy}";
|
||||
rank.UpdateRank(scoreInfo.Rank);
|
||||
|
||||
totalScore.Value = $@"{score.TotalScore:N0}";
|
||||
accuracy.Value = $@"{score.Accuracy:P2}";
|
||||
statistics.Value = $"{score.Statistics[HitResult.Great]}/{score.Statistics[HitResult.Good]}/{score.Statistics[HitResult.Meh]}";
|
||||
totalScore.Value = $@"{scoreInfo.TotalScore:N0}";
|
||||
accuracy.Value = $@"{scoreInfo.Accuracy:P2}";
|
||||
statistics.Value = $"{scoreInfo.Statistics[HitResult.Great]}/{scoreInfo.Statistics[HitResult.Good]}/{scoreInfo.Statistics[HitResult.Meh]}";
|
||||
|
||||
modsContainer.Clear();
|
||||
foreach (Mod mod in score.Mods)
|
||||
foreach (Mod mod in scoreInfo.Mods)
|
||||
modsContainer.Add(new ModIcon(mod)
|
||||
{
|
||||
AutoSizeAxes = Axes.Both,
|
||||
|
@ -29,10 +29,10 @@ namespace osu.Game.Overlays.BeatmapSet.Scores
|
||||
set => loadingAnimation.FadeTo(value ? 1 : 0, fade_duration);
|
||||
}
|
||||
|
||||
private IEnumerable<APIScore> scores;
|
||||
private IEnumerable<APIScoreInfo> scores;
|
||||
private BeatmapInfo beatmap;
|
||||
|
||||
public IEnumerable<APIScore> Scores
|
||||
public IEnumerable<APIScoreInfo> Scores
|
||||
{
|
||||
get { return scores; }
|
||||
set
|
||||
@ -80,7 +80,7 @@ namespace osu.Game.Overlays.BeatmapSet.Scores
|
||||
return;
|
||||
}
|
||||
|
||||
topScore.Score = scores.FirstOrDefault();
|
||||
topScore.ScoreInfo = scores.FirstOrDefault();
|
||||
topScore.Show();
|
||||
|
||||
flow.Clear();
|
||||
|
@ -13,8 +13,8 @@ namespace osu.Game.Overlays.Profile.Sections.Ranks
|
||||
{
|
||||
private readonly double? weight;
|
||||
|
||||
public DrawablePerformanceScore(Score score, double? weight = null)
|
||||
: base(score)
|
||||
public DrawablePerformanceScore(ScoreInfo scoreInfo, double? weight = null)
|
||||
: base(scoreInfo)
|
||||
{
|
||||
this.weight = weight;
|
||||
}
|
||||
@ -22,7 +22,7 @@ namespace osu.Game.Overlays.Profile.Sections.Ranks
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(OsuColour colour)
|
||||
{
|
||||
double pp = Score.PP ?? 0;
|
||||
double pp = ScoreInfo.PP ?? 0;
|
||||
RightFlowContainer.Add(new OsuSpriteText
|
||||
{
|
||||
Text = $"{pp:0}pp",
|
||||
|
@ -16,11 +16,11 @@ namespace osu.Game.Overlays.Profile.Sections.Ranks
|
||||
public abstract class DrawableProfileScore : DrawableProfileRow
|
||||
{
|
||||
private readonly ScoreModsContainer modsContainer;
|
||||
protected readonly Score Score;
|
||||
protected readonly ScoreInfo ScoreInfo;
|
||||
|
||||
protected DrawableProfileScore(Score score)
|
||||
protected DrawableProfileScore(ScoreInfo scoreInfo)
|
||||
{
|
||||
Score = score;
|
||||
ScoreInfo = scoreInfo;
|
||||
|
||||
RelativeSizeAxes = Axes.X;
|
||||
Height = 60;
|
||||
@ -42,7 +42,7 @@ namespace osu.Game.Overlays.Profile.Sections.Ranks
|
||||
{
|
||||
var text = new OsuSpriteText
|
||||
{
|
||||
Text = $"accuracy: {Score.Accuracy:P2}",
|
||||
Text = $"accuracy: {ScoreInfo.Accuracy:P2}",
|
||||
Anchor = Anchor.TopRight,
|
||||
Origin = Anchor.TopRight,
|
||||
Colour = colour.GrayA,
|
||||
@ -53,14 +53,14 @@ namespace osu.Game.Overlays.Profile.Sections.Ranks
|
||||
RightFlowContainer.Add(text);
|
||||
RightFlowContainer.SetLayoutPosition(text, 1);
|
||||
|
||||
LeftFlowContainer.Add(new BeatmapMetadataContainer(Score.BeatmapInfo));
|
||||
LeftFlowContainer.Add(new DrawableDate(Score.Date));
|
||||
LeftFlowContainer.Add(new BeatmapMetadataContainer(ScoreInfo.BeatmapInfo));
|
||||
LeftFlowContainer.Add(new DrawableDate(ScoreInfo.Date));
|
||||
|
||||
foreach (Mod mod in Score.Mods)
|
||||
foreach (Mod mod in ScoreInfo.Mods)
|
||||
modsContainer.Add(new ModIcon(mod) { Scale = new Vector2(0.5f) });
|
||||
}
|
||||
|
||||
protected override Drawable CreateLeftVisual() => new DrawableRank(Score.Rank)
|
||||
protected override Drawable CreateLeftVisual() => new DrawableRank(ScoreInfo.Rank)
|
||||
{
|
||||
RelativeSizeAxes = Axes.Y,
|
||||
Width = 60,
|
||||
|
@ -10,8 +10,8 @@ namespace osu.Game.Overlays.Profile.Sections.Ranks
|
||||
{
|
||||
public class DrawableTotalScore : DrawableProfileScore
|
||||
{
|
||||
public DrawableTotalScore(Score score)
|
||||
: base(score)
|
||||
public DrawableTotalScore(ScoreInfo scoreInfo)
|
||||
: base(scoreInfo)
|
||||
{
|
||||
}
|
||||
|
||||
@ -20,7 +20,7 @@ namespace osu.Game.Overlays.Profile.Sections.Ranks
|
||||
{
|
||||
RightFlowContainer.Add(new OsuSpriteText
|
||||
{
|
||||
Text = Score.TotalScore.ToString("#,###"),
|
||||
Text = ScoreInfo.TotalScore.ToString("#,###"),
|
||||
Anchor = Anchor.TopRight,
|
||||
Origin = Anchor.TopRight,
|
||||
TextSize = 18,
|
||||
|
@ -50,7 +50,7 @@ namespace osu.Game.Overlays.Profile.Sections.Ranks
|
||||
|
||||
MissingText.Hide();
|
||||
|
||||
foreach (APIScore score in scores)
|
||||
foreach (APIScoreInfo score in scores)
|
||||
{
|
||||
DrawableProfileScore drawableScore;
|
||||
|
||||
|
@ -17,21 +17,21 @@ namespace osu.Game.Rulesets.Difficulty
|
||||
|
||||
protected readonly Ruleset Ruleset;
|
||||
protected readonly IBeatmap Beatmap;
|
||||
protected readonly Score Score;
|
||||
protected readonly ScoreInfo ScoreInfo;
|
||||
|
||||
protected double TimeRate { get; private set; } = 1;
|
||||
|
||||
protected PerformanceCalculator(Ruleset ruleset, WorkingBeatmap beatmap, Score score)
|
||||
protected PerformanceCalculator(Ruleset ruleset, WorkingBeatmap beatmap, ScoreInfo scoreInfo)
|
||||
{
|
||||
Ruleset = ruleset;
|
||||
Score = score;
|
||||
ScoreInfo = scoreInfo;
|
||||
|
||||
beatmap.Mods.Value = score.Mods;
|
||||
beatmap.Mods.Value = scoreInfo.Mods;
|
||||
Beatmap = beatmap.GetPlayableBeatmap(ruleset.RulesetInfo);
|
||||
|
||||
Attributes = ruleset.CreateDifficultyCalculator(beatmap).Calculate(score.Mods);
|
||||
Attributes = ruleset.CreateDifficultyCalculator(beatmap).Calculate(scoreInfo.Mods);
|
||||
|
||||
ApplyMods(score.Mods);
|
||||
ApplyMods(scoreInfo.Mods);
|
||||
}
|
||||
|
||||
protected virtual void ApplyMods(Mod[] mods)
|
||||
|
@ -14,7 +14,7 @@ namespace osu.Game.Rulesets.Mods
|
||||
public abstract class ModAutoplay<T> : ModAutoplay, IApplicableToRulesetContainer<T>
|
||||
where T : HitObject
|
||||
{
|
||||
protected virtual Score CreateReplayScore(Beatmap<T> beatmap) => new Score { Replay = new Replay() };
|
||||
protected virtual ScoreInfo CreateReplayScore(Beatmap<T> beatmap) => new ScoreInfo { Replay = new Replay() };
|
||||
|
||||
public override bool HasImplementation => GetType().GenericTypeArguments.Length == 0;
|
||||
|
||||
|
@ -73,7 +73,7 @@ namespace osu.Game.Rulesets
|
||||
|
||||
public abstract DifficultyCalculator CreateDifficultyCalculator(WorkingBeatmap beatmap);
|
||||
|
||||
public virtual PerformanceCalculator CreatePerformanceCalculator(WorkingBeatmap beatmap, Score score) => null;
|
||||
public virtual PerformanceCalculator CreatePerformanceCalculator(WorkingBeatmap beatmap, ScoreInfo scoreInfo) => null;
|
||||
|
||||
public virtual HitObjectComposer CreateHitObjectComposer() => null;
|
||||
|
||||
|
@ -158,15 +158,15 @@ namespace osu.Game.Rulesets.Scoring
|
||||
/// <summary>
|
||||
/// Retrieve a score populated with data for the current play this processor is responsible for.
|
||||
/// </summary>
|
||||
public virtual void PopulateScore(Score score)
|
||||
public virtual void PopulateScore(ScoreInfo scoreInfo)
|
||||
{
|
||||
score.TotalScore = TotalScore;
|
||||
score.Combo = Combo;
|
||||
score.MaxCombo = HighestCombo;
|
||||
score.Accuracy = Accuracy;
|
||||
score.Rank = Rank;
|
||||
score.Date = DateTimeOffset.Now;
|
||||
score.Health = Health;
|
||||
scoreInfo.TotalScore = TotalScore;
|
||||
scoreInfo.Combo = Combo;
|
||||
scoreInfo.MaxCombo = HighestCombo;
|
||||
scoreInfo.Accuracy = Accuracy;
|
||||
scoreInfo.Rank = Rank;
|
||||
scoreInfo.Date = DateTimeOffset.Now;
|
||||
scoreInfo.Health = Health;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -22,22 +22,22 @@ namespace osu.Game.Scoring.Legacy
|
||||
private IBeatmap currentBeatmap;
|
||||
private Ruleset currentRuleset;
|
||||
|
||||
public Score Parse(Stream stream)
|
||||
public ScoreInfo Parse(Stream stream)
|
||||
{
|
||||
Score score;
|
||||
ScoreInfo scoreInfo;
|
||||
|
||||
using (SerializationReader sr = new SerializationReader(stream))
|
||||
{
|
||||
currentRuleset = GetRuleset(sr.ReadByte());
|
||||
score = new Score { Ruleset = currentRuleset.RulesetInfo };
|
||||
scoreInfo = new ScoreInfo { Ruleset = currentRuleset.RulesetInfo };
|
||||
|
||||
var version = sr.ReadInt32();
|
||||
|
||||
currentBeatmap = GetBeatmap(sr.ReadString()).Beatmap;
|
||||
score.BeatmapInfo = currentBeatmap.BeatmapInfo;
|
||||
scoreInfo.BeatmapInfo = currentBeatmap.BeatmapInfo;
|
||||
|
||||
score.User = new User { Username = sr.ReadString() };
|
||||
score.MD5Hash = sr.ReadString();
|
||||
scoreInfo.User = new User { Username = sr.ReadString() };
|
||||
scoreInfo.MD5Hash = sr.ReadString();
|
||||
|
||||
var count300 = sr.ReadUInt16();
|
||||
var count100 = sr.ReadUInt16();
|
||||
@ -46,57 +46,57 @@ namespace osu.Game.Scoring.Legacy
|
||||
var countKatu = sr.ReadUInt16();
|
||||
var countMiss = sr.ReadUInt16();
|
||||
|
||||
score.Statistics[HitResult.Great] = count300;
|
||||
score.Statistics[HitResult.Good] = count100;
|
||||
score.Statistics[HitResult.Meh] = count50;
|
||||
score.Statistics[HitResult.Perfect] = countGeki;
|
||||
score.Statistics[HitResult.Ok] = countKatu;
|
||||
score.Statistics[HitResult.Miss] = countMiss;
|
||||
scoreInfo.Statistics[HitResult.Great] = count300;
|
||||
scoreInfo.Statistics[HitResult.Good] = count100;
|
||||
scoreInfo.Statistics[HitResult.Meh] = count50;
|
||||
scoreInfo.Statistics[HitResult.Perfect] = countGeki;
|
||||
scoreInfo.Statistics[HitResult.Ok] = countKatu;
|
||||
scoreInfo.Statistics[HitResult.Miss] = countMiss;
|
||||
|
||||
score.TotalScore = sr.ReadInt32();
|
||||
score.MaxCombo = sr.ReadUInt16();
|
||||
scoreInfo.TotalScore = sr.ReadInt32();
|
||||
scoreInfo.MaxCombo = sr.ReadUInt16();
|
||||
|
||||
/* score.Perfect = */
|
||||
sr.ReadBoolean();
|
||||
|
||||
score.Mods = currentRuleset.ConvertLegacyMods((LegacyMods)sr.ReadInt32()).ToArray();
|
||||
scoreInfo.Mods = currentRuleset.ConvertLegacyMods((LegacyMods)sr.ReadInt32()).ToArray();
|
||||
|
||||
/* score.HpGraphString = */
|
||||
sr.ReadString();
|
||||
|
||||
score.Date = sr.ReadDateTime();
|
||||
scoreInfo.Date = sr.ReadDateTime();
|
||||
|
||||
var compressedReplay = sr.ReadByteArray();
|
||||
|
||||
if (version >= 20140721)
|
||||
score.OnlineScoreID = sr.ReadInt64();
|
||||
scoreInfo.OnlineScoreID = sr.ReadInt64();
|
||||
else if (version >= 20121008)
|
||||
score.OnlineScoreID = sr.ReadInt32();
|
||||
scoreInfo.OnlineScoreID = sr.ReadInt32();
|
||||
|
||||
switch (score.Ruleset.ID)
|
||||
switch (scoreInfo.Ruleset.ID)
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
int totalHits = count50 + count100 + count300 + countMiss;
|
||||
score.Accuracy = totalHits > 0 ? (double)(count50 * 50 + count100 * 100 + count300 * 300) / (totalHits * 300) : 1;
|
||||
scoreInfo.Accuracy = totalHits > 0 ? (double)(count50 * 50 + count100 * 100 + count300 * 300) / (totalHits * 300) : 1;
|
||||
break;
|
||||
}
|
||||
case 1:
|
||||
{
|
||||
int totalHits = count50 + count100 + count300 + countMiss;
|
||||
score.Accuracy = totalHits > 0 ? (double)(count100 * 150 + count300 * 300) / (totalHits * 300) : 1;
|
||||
scoreInfo.Accuracy = totalHits > 0 ? (double)(count100 * 150 + count300 * 300) / (totalHits * 300) : 1;
|
||||
break;
|
||||
}
|
||||
case 2:
|
||||
{
|
||||
int totalHits = count50 + count100 + count300 + countMiss + countKatu;
|
||||
score.Accuracy = totalHits > 0 ? (double)(count50 + count100 + count300 ) / totalHits : 1;
|
||||
scoreInfo.Accuracy = totalHits > 0 ? (double)(count50 + count100 + count300 ) / totalHits : 1;
|
||||
break;
|
||||
}
|
||||
case 3:
|
||||
{
|
||||
int totalHits = count50 + count100 + count300 + countMiss + countGeki + countKatu;
|
||||
score.Accuracy = totalHits > 0 ? (double)(count50 * 50 + count100 * 100 + countKatu * 200 + (count300 + countGeki) * 300) / (totalHits * 300) : 1;
|
||||
scoreInfo.Accuracy = totalHits > 0 ? (double)(count50 * 50 + count100 * 100 + countKatu * 200 + (count300 + countGeki) * 300) / (totalHits * 300) : 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -120,13 +120,13 @@ namespace osu.Game.Scoring.Legacy
|
||||
using (var lzma = new LzmaStream(properties, replayInStream, compressedSize, outSize))
|
||||
using (var reader = new StreamReader(lzma))
|
||||
{
|
||||
score.Replay = new Replay { User = score.User };
|
||||
readLegacyReplay(score.Replay, reader);
|
||||
scoreInfo.Replay = new Replay { User = scoreInfo.User };
|
||||
readLegacyReplay(scoreInfo.Replay, reader);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return score;
|
||||
return scoreInfo;
|
||||
}
|
||||
|
||||
private void readLegacyReplay(Replay replay, StreamReader reader)
|
||||
|
@ -17,7 +17,7 @@ using osu.Game.Rulesets.Scoring;
|
||||
|
||||
namespace osu.Game.Scoring
|
||||
{
|
||||
public class Score : IHasFiles<ScoreFileInfo>, IHasPrimaryKey, ISoftDelete
|
||||
public class ScoreInfo : IHasFiles<ScoreFileInfo>, IHasPrimaryKey, ISoftDelete
|
||||
{
|
||||
[JsonIgnore]
|
||||
public int ID { get; set; }
|
@ -15,7 +15,7 @@ using osu.Game.Scoring.Legacy;
|
||||
|
||||
namespace osu.Game.Scoring
|
||||
{
|
||||
public class ScoreManager : ArchiveModelManager<Score, ScoreFileInfo>
|
||||
public class ScoreManager : ArchiveModelManager<ScoreInfo, ScoreFileInfo>
|
||||
{
|
||||
public override string[] HandledExtensions => new[] { ".osr" };
|
||||
|
||||
@ -35,7 +35,7 @@ namespace osu.Game.Scoring
|
||||
scores = (ScoreStore)ModelStore;
|
||||
}
|
||||
|
||||
protected override Score CreateModel(ArchiveReader archive)
|
||||
protected override ScoreInfo CreateModel(ArchiveReader archive)
|
||||
{
|
||||
if (archive == null)
|
||||
return null;
|
||||
@ -44,7 +44,7 @@ namespace osu.Game.Scoring
|
||||
return new DatabasedLegacyScoreParser(rulesets, beatmaps).Parse(stream);
|
||||
}
|
||||
|
||||
protected override Score CheckForExisting(Score model)
|
||||
protected override ScoreInfo CheckForExisting(ScoreInfo model)
|
||||
{
|
||||
var existingHashMatch = scores.ConsumableItems.FirstOrDefault(s => s.MD5Hash == model.MD5Hash);
|
||||
if (existingHashMatch != null)
|
||||
@ -56,8 +56,8 @@ namespace osu.Game.Scoring
|
||||
return null;
|
||||
}
|
||||
|
||||
public List<Score> GetAllScores() => ModelStore.ConsumableItems.Where(s => !s.DeletePending).ToList();
|
||||
public List<ScoreInfo> GetAllScores() => ModelStore.ConsumableItems.Where(s => !s.DeletePending).ToList();
|
||||
|
||||
public Score Query(Expression<Func<Score, bool>> query) => ModelStore.ConsumableItems.AsNoTracking().FirstOrDefault(query);
|
||||
public ScoreInfo Query(Expression<Func<ScoreInfo, bool>> query) => ModelStore.ConsumableItems.AsNoTracking().FirstOrDefault(query);
|
||||
}
|
||||
}
|
||||
|
@ -8,14 +8,14 @@ using osu.Game.Database;
|
||||
|
||||
namespace osu.Game.Scoring
|
||||
{
|
||||
public class ScoreStore : MutableDatabaseBackedStore<Score>
|
||||
public class ScoreStore : MutableDatabaseBackedStore<ScoreInfo>
|
||||
{
|
||||
public ScoreStore(IDatabaseContextFactory factory, Storage storage)
|
||||
: base(factory, storage)
|
||||
{
|
||||
}
|
||||
|
||||
protected override IQueryable<Score> AddIncludesForConsumption(IQueryable<Score> query)
|
||||
protected override IQueryable<ScoreInfo> AddIncludesForConsumption(IQueryable<ScoreInfo> query)
|
||||
=> base.AddIncludesForConsumption(query).Include(s => s.Files).ThenInclude(f => f.FileInfo);
|
||||
}
|
||||
}
|
||||
|
@ -273,7 +273,7 @@ namespace osu.Game.Screens.Play
|
||||
{
|
||||
if (!IsCurrentScreen) return;
|
||||
|
||||
var score = new Score
|
||||
var score = new ScoreInfo
|
||||
{
|
||||
BeatmapInfo = Beatmap.Value.BeatmapInfo,
|
||||
Ruleset = ruleset
|
||||
|
@ -23,7 +23,7 @@ namespace osu.Game.Screens.Ranking
|
||||
{
|
||||
public class Results : OsuScreen
|
||||
{
|
||||
private readonly Score score;
|
||||
private readonly ScoreInfo scoreInfo;
|
||||
private Container circleOuterBackground;
|
||||
private Container circleOuter;
|
||||
private Container circleInner;
|
||||
@ -44,9 +44,9 @@ namespace osu.Game.Screens.Ranking
|
||||
|
||||
private const float circle_outer_scale = 0.96f;
|
||||
|
||||
public Results(Score score)
|
||||
public Results(ScoreInfo scoreInfo)
|
||||
{
|
||||
this.score = score;
|
||||
this.scoreInfo = scoreInfo;
|
||||
}
|
||||
|
||||
private const float transition_time = 800;
|
||||
@ -188,7 +188,7 @@ namespace osu.Game.Screens.Ranking
|
||||
},
|
||||
new OsuSpriteText
|
||||
{
|
||||
Text = $"{score.MaxCombo}x",
|
||||
Text = $"{scoreInfo.MaxCombo}x",
|
||||
TextSize = 40,
|
||||
RelativePositionAxes = Axes.X,
|
||||
Font = @"Exo2.0-Bold",
|
||||
@ -209,7 +209,7 @@ namespace osu.Game.Screens.Ranking
|
||||
},
|
||||
new OsuSpriteText
|
||||
{
|
||||
Text = $"{score.Accuracy:P2}",
|
||||
Text = $"{scoreInfo.Accuracy:P2}",
|
||||
TextSize = 40,
|
||||
RelativePositionAxes = Axes.X,
|
||||
Font = @"Exo2.0-Bold",
|
||||
@ -274,10 +274,10 @@ namespace osu.Game.Screens.Ranking
|
||||
switch (mode)
|
||||
{
|
||||
case ResultMode.Summary:
|
||||
currentPage = new ResultsPageScore(score, Beatmap.Value);
|
||||
currentPage = new ResultsPageScore(scoreInfo, Beatmap.Value);
|
||||
break;
|
||||
case ResultMode.Ranking:
|
||||
currentPage = new ResultsPageRanking(score, Beatmap.Value);
|
||||
currentPage = new ResultsPageRanking(scoreInfo, Beatmap.Value);
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -16,16 +16,16 @@ namespace osu.Game.Screens.Ranking
|
||||
{
|
||||
public class ResultsPage : Container
|
||||
{
|
||||
protected readonly Score Score;
|
||||
protected readonly ScoreInfo ScoreInfo;
|
||||
protected readonly WorkingBeatmap Beatmap;
|
||||
private CircularContainer content;
|
||||
private Box fill;
|
||||
|
||||
protected override Container<Drawable> Content => content;
|
||||
|
||||
public ResultsPage(Score score, WorkingBeatmap beatmap)
|
||||
public ResultsPage(ScoreInfo scoreInfo, WorkingBeatmap beatmap)
|
||||
{
|
||||
Score = score;
|
||||
ScoreInfo = scoreInfo;
|
||||
Beatmap = beatmap;
|
||||
RelativeSizeAxes = Axes.Both;
|
||||
}
|
||||
|
@ -14,7 +14,7 @@ namespace osu.Game.Screens.Ranking
|
||||
{
|
||||
public class ResultsPageRanking : ResultsPage
|
||||
{
|
||||
public ResultsPageRanking(Score score, WorkingBeatmap beatmap = null) : base(score, beatmap)
|
||||
public ResultsPageRanking(ScoreInfo scoreInfo, WorkingBeatmap beatmap = null) : base(scoreInfo, beatmap)
|
||||
{
|
||||
}
|
||||
|
||||
@ -33,7 +33,7 @@ namespace osu.Game.Screens.Ranking
|
||||
Origin = Anchor.Centre,
|
||||
Anchor = Anchor.Centre,
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Beatmap = Beatmap.BeatmapInfo ?? Score.BeatmapInfo,
|
||||
Beatmap = Beatmap.BeatmapInfo ?? ScoreInfo.BeatmapInfo,
|
||||
Scale = new Vector2(0.7f)
|
||||
}
|
||||
};
|
||||
|
@ -33,7 +33,7 @@ namespace osu.Game.Screens.Ranking
|
||||
private Container scoreContainer;
|
||||
private ScoreCounter scoreCounter;
|
||||
|
||||
public ResultsPageScore(Score score, WorkingBeatmap beatmap) : base(score, beatmap) { }
|
||||
public ResultsPageScore(ScoreInfo scoreInfo, WorkingBeatmap beatmap) : base(scoreInfo, beatmap) { }
|
||||
|
||||
private FillFlowContainer<DrawableScoreStatistic> statisticsContainer;
|
||||
|
||||
@ -64,14 +64,14 @@ namespace osu.Game.Screens.Ranking
|
||||
Direction = FillDirection.Vertical,
|
||||
Children = new Drawable[]
|
||||
{
|
||||
new UserHeader(Score.User)
|
||||
new UserHeader(ScoreInfo.User)
|
||||
{
|
||||
Anchor = Anchor.TopCentre,
|
||||
Origin = Anchor.TopCentre,
|
||||
RelativeSizeAxes = Axes.X,
|
||||
Height = user_header_height,
|
||||
},
|
||||
new DrawableRank(Score.Rank)
|
||||
new DrawableRank(ScoreInfo.Rank)
|
||||
{
|
||||
Anchor = Anchor.TopCentre,
|
||||
Origin = Anchor.TopCentre,
|
||||
@ -119,7 +119,7 @@ namespace osu.Game.Screens.Ranking
|
||||
Origin = Anchor.TopCentre,
|
||||
Margin = new MarginPadding { Bottom = 10 },
|
||||
},
|
||||
new DateTimeDisplay(Score.Date.LocalDateTime)
|
||||
new DateTimeDisplay(ScoreInfo.Date.LocalDateTime)
|
||||
{
|
||||
Anchor = Anchor.TopCentre,
|
||||
Origin = Anchor.TopCentre,
|
||||
@ -166,7 +166,7 @@ namespace osu.Game.Screens.Ranking
|
||||
}
|
||||
};
|
||||
|
||||
statisticsContainer.ChildrenEnumerable = Score.Statistics.OrderByDescending(p => p.Key).Select(s => new DrawableScoreStatistic(s));
|
||||
statisticsContainer.ChildrenEnumerable = ScoreInfo.Statistics.OrderByDescending(p => p.Key).Select(s => new DrawableScoreStatistic(s));
|
||||
}
|
||||
|
||||
protected override void LoadComplete()
|
||||
@ -175,7 +175,7 @@ namespace osu.Game.Screens.Ranking
|
||||
|
||||
Schedule(() =>
|
||||
{
|
||||
scoreCounter.Increment(Score.TotalScore);
|
||||
scoreCounter.Increment(ScoreInfo.TotalScore);
|
||||
|
||||
int delay = 0;
|
||||
foreach (var s in statisticsContainer.Children)
|
||||
|
@ -34,7 +34,7 @@ namespace osu.Game.Screens.Select.Leaderboards
|
||||
|
||||
private readonly IBindable<RulesetInfo> ruleset = new Bindable<RulesetInfo>();
|
||||
|
||||
public Action<Score> ScoreSelected;
|
||||
public Action<ScoreInfo> ScoreSelected;
|
||||
|
||||
private readonly LoadingAnimation loading;
|
||||
|
||||
@ -42,9 +42,9 @@ namespace osu.Game.Screens.Select.Leaderboards
|
||||
|
||||
private bool scoresLoadedOnce;
|
||||
|
||||
private IEnumerable<Score> scores;
|
||||
private IEnumerable<ScoreInfo> scores;
|
||||
|
||||
public IEnumerable<Score> Scores
|
||||
public IEnumerable<ScoreInfo> Scores
|
||||
{
|
||||
get { return scores; }
|
||||
set
|
||||
|
@ -25,7 +25,7 @@ namespace osu.Game.Screens.Select.Leaderboards
|
||||
public static readonly float HEIGHT = 60;
|
||||
|
||||
public readonly int RankPosition;
|
||||
public readonly Score Score;
|
||||
public readonly ScoreInfo ScoreInfo;
|
||||
|
||||
private const float corner_radius = 5;
|
||||
private const float edge_margin = 5;
|
||||
@ -43,9 +43,9 @@ namespace osu.Game.Screens.Select.Leaderboards
|
||||
private Container flagBadgeContainer;
|
||||
private FillFlowContainer<ModIcon> modsContainer;
|
||||
|
||||
public LeaderboardScore(Score score, int rank)
|
||||
public LeaderboardScore(ScoreInfo scoreInfo, int rank)
|
||||
{
|
||||
Score = score;
|
||||
ScoreInfo = scoreInfo;
|
||||
RankPosition = rank;
|
||||
|
||||
RelativeSizeAxes = Axes.X;
|
||||
@ -102,7 +102,7 @@ namespace osu.Game.Screens.Select.Leaderboards
|
||||
Children = new[]
|
||||
{
|
||||
avatar = new DelayedLoadWrapper(
|
||||
new Avatar(Score.User)
|
||||
new Avatar(ScoreInfo.User)
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
CornerRadius = corner_radius,
|
||||
@ -128,7 +128,7 @@ namespace osu.Game.Screens.Select.Leaderboards
|
||||
{
|
||||
nameLabel = new OsuSpriteText
|
||||
{
|
||||
Text = Score.User.Username,
|
||||
Text = ScoreInfo.User.Username,
|
||||
Font = @"Exo2.0-BoldItalic",
|
||||
TextSize = 23,
|
||||
},
|
||||
@ -149,7 +149,7 @@ namespace osu.Game.Screens.Select.Leaderboards
|
||||
Masking = true,
|
||||
Children = new Drawable[]
|
||||
{
|
||||
new DrawableFlag(Score.User?.Country)
|
||||
new DrawableFlag(ScoreInfo.User?.Country)
|
||||
{
|
||||
Width = 30,
|
||||
RelativeSizeAxes = Axes.Y,
|
||||
@ -166,8 +166,8 @@ namespace osu.Game.Screens.Select.Leaderboards
|
||||
Margin = new MarginPadding { Left = edge_margin },
|
||||
Children = new Drawable[]
|
||||
{
|
||||
maxCombo = new ScoreComponentLabel(FontAwesome.fa_link, Score.MaxCombo.ToString(), "Max Combo"),
|
||||
accuracy = new ScoreComponentLabel(FontAwesome.fa_crosshairs, string.Format(Score.Accuracy % 1 == 0 ? @"{0:P0}" : @"{0:P2}", Score.Accuracy), "Accuracy"),
|
||||
maxCombo = new ScoreComponentLabel(FontAwesome.fa_link, ScoreInfo.MaxCombo.ToString(), "Max Combo"),
|
||||
accuracy = new ScoreComponentLabel(FontAwesome.fa_crosshairs, string.Format(ScoreInfo.Accuracy % 1 == 0 ? @"{0:P0}" : @"{0:P2}", ScoreInfo.Accuracy), "Accuracy"),
|
||||
},
|
||||
},
|
||||
},
|
||||
@ -183,13 +183,13 @@ namespace osu.Game.Screens.Select.Leaderboards
|
||||
Spacing = new Vector2(5f, 0f),
|
||||
Children = new Drawable[]
|
||||
{
|
||||
scoreLabel = new GlowingSpriteText(Score.TotalScore.ToString(@"N0"), @"Venera", 23, Color4.White, OsuColour.FromHex(@"83ccfa")),
|
||||
scoreLabel = new GlowingSpriteText(ScoreInfo.TotalScore.ToString(@"N0"), @"Venera", 23, Color4.White, OsuColour.FromHex(@"83ccfa")),
|
||||
new Container
|
||||
{
|
||||
Size = new Vector2(40f, 20f),
|
||||
Children = new[]
|
||||
{
|
||||
scoreRank = new DrawableRank(Score.Rank)
|
||||
scoreRank = new DrawableRank(ScoreInfo.Rank)
|
||||
{
|
||||
Anchor = Anchor.Centre,
|
||||
Origin = Anchor.Centre,
|
||||
@ -205,7 +205,7 @@ namespace osu.Game.Screens.Select.Leaderboards
|
||||
Origin = Anchor.BottomRight,
|
||||
AutoSizeAxes = Axes.Both,
|
||||
Direction = FillDirection.Horizontal,
|
||||
ChildrenEnumerable = Score.Mods.Select(mod => new ModIcon(mod) { Scale = new Vector2(0.375f) })
|
||||
ChildrenEnumerable = ScoreInfo.Mods.Select(mod => new ModIcon(mod) { Scale = new Vector2(0.375f) })
|
||||
},
|
||||
},
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user