diff --git a/osu.Game.Rulesets.Mania/Difficulty/ManiaPerformanceCalculator.cs b/osu.Game.Rulesets.Mania/Difficulty/ManiaPerformanceCalculator.cs index a845f1d2ad..610c7a8fee 100644 --- a/osu.Game.Rulesets.Mania/Difficulty/ManiaPerformanceCalculator.cs +++ b/osu.Game.Rulesets.Mania/Difficulty/ManiaPerformanceCalculator.cs @@ -28,21 +28,21 @@ namespace osu.Game.Rulesets.Mania.Difficulty private int countMeh; private int countMiss; - public ManiaPerformanceCalculator(Ruleset ruleset, WorkingBeatmap beatmap, ScoreInfo scoreInfo) - : base(ruleset, beatmap, scoreInfo) + public ManiaPerformanceCalculator(Ruleset ruleset, WorkingBeatmap beatmap, ScoreInfo score) + : base(ruleset, beatmap, score) { } public override double Calculate(Dictionary categoryDifficulty = null) { - 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]); + 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]); if (mods.Any(m => !m.Ranked)) return 0; diff --git a/osu.Game.Rulesets.Mania/ManiaRuleset.cs b/osu.Game.Rulesets.Mania/ManiaRuleset.cs index e02e6225e3..392d10b414 100644 --- a/osu.Game.Rulesets.Mania/ManiaRuleset.cs +++ b/osu.Game.Rulesets.Mania/ManiaRuleset.cs @@ -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, ScoreInfo scoreInfo) => new ManiaPerformanceCalculator(this, beatmap, scoreInfo); + public override PerformanceCalculator CreatePerformanceCalculator(WorkingBeatmap beatmap, ScoreInfo score) => new ManiaPerformanceCalculator(this, beatmap, score); public override HitObjectComposer CreateHitObjectComposer() => new ManiaHitObjectComposer(this); diff --git a/osu.Game.Rulesets.Osu/Difficulty/OsuPerformanceCalculator.cs b/osu.Game.Rulesets.Osu/Difficulty/OsuPerformanceCalculator.cs index ed6bdbd155..5e66d43c98 100644 --- a/osu.Game.Rulesets.Osu/Difficulty/OsuPerformanceCalculator.cs +++ b/osu.Game.Rulesets.Osu/Difficulty/OsuPerformanceCalculator.cs @@ -30,8 +30,8 @@ namespace osu.Game.Rulesets.Osu.Difficulty private int countMeh; private int countMiss; - public OsuPerformanceCalculator(Ruleset ruleset, WorkingBeatmap beatmap, ScoreInfo scoreInfo) - : base(ruleset, beatmap, scoreInfo) + public OsuPerformanceCalculator(Ruleset ruleset, WorkingBeatmap beatmap, ScoreInfo score) + : base(ruleset, beatmap, score) { countHitCircles = Beatmap.HitObjects.Count(h => h is HitCircle); @@ -42,13 +42,13 @@ namespace osu.Game.Rulesets.Osu.Difficulty public override double Calculate(Dictionary categoryRatings = null) { - 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]); + 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]); // Don't count scores made with supposedly unranked mods if (mods.Any(m => !m.Ranked)) diff --git a/osu.Game.Rulesets.Osu/OsuRuleset.cs b/osu.Game.Rulesets.Osu/OsuRuleset.cs index dac9181fc9..d1192e4165 100644 --- a/osu.Game.Rulesets.Osu/OsuRuleset.cs +++ b/osu.Game.Rulesets.Osu/OsuRuleset.cs @@ -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, ScoreInfo scoreInfo) => new OsuPerformanceCalculator(this, beatmap, scoreInfo); + public override PerformanceCalculator CreatePerformanceCalculator(WorkingBeatmap beatmap, ScoreInfo score) => new OsuPerformanceCalculator(this, beatmap, score); public override HitObjectComposer CreateHitObjectComposer() => new OsuHitObjectComposer(this); diff --git a/osu.Game.Rulesets.Osu/Scoring/OsuScoreProcessor.cs b/osu.Game.Rulesets.Osu/Scoring/OsuScoreProcessor.cs index cec6c50677..9b3da1b8a8 100644 --- a/osu.Game.Rulesets.Osu/Scoring/OsuScoreProcessor.cs +++ b/osu.Game.Rulesets.Osu/Scoring/OsuScoreProcessor.cs @@ -40,14 +40,14 @@ namespace osu.Game.Rulesets.Osu.Scoring comboResultCounts.Clear(); } - public override void PopulateScore(ScoreInfo scoreInfo) + public override void PopulateScore(ScoreInfo score) { - base.PopulateScore(scoreInfo); + base.PopulateScore(score); - 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); + 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); } private const double harshness = 0.01; diff --git a/osu.Game.Rulesets.Taiko/Difficulty/TaikoPerformanceCalculator.cs b/osu.Game.Rulesets.Taiko/Difficulty/TaikoPerformanceCalculator.cs index 788c09d75a..e4960c9680 100644 --- a/osu.Game.Rulesets.Taiko/Difficulty/TaikoPerformanceCalculator.cs +++ b/osu.Game.Rulesets.Taiko/Difficulty/TaikoPerformanceCalculator.cs @@ -23,18 +23,18 @@ namespace osu.Game.Rulesets.Taiko.Difficulty private int countMeh; private int countMiss; - public TaikoPerformanceCalculator(Ruleset ruleset, WorkingBeatmap beatmap, ScoreInfo scoreInfo) - : base(ruleset, beatmap, scoreInfo) + public TaikoPerformanceCalculator(Ruleset ruleset, WorkingBeatmap beatmap, ScoreInfo score) + : base(ruleset, beatmap, score) { } public override double Calculate(Dictionary categoryDifficulty = null) { - 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]); + 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]); // 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(ScoreInfo.MaxCombo, 0.5) / Math.Pow(Attributes.MaxCombo, 0.5), 1.0); + strainValue *= Math.Min(Math.Pow(Score.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 * ScoreInfo.Accuracy; + return strainValue * Score.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(ScoreInfo.Accuracy, 15) * 22.0; + double accValue = Math.Pow(150.0 / Attributes.GreatHitWindow, 1.1) * Math.Pow(Score.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)); diff --git a/osu.Game.Rulesets.Taiko/TaikoRuleset.cs b/osu.Game.Rulesets.Taiko/TaikoRuleset.cs index 9b425c0ce9..7094f9d71b 100644 --- a/osu.Game.Rulesets.Taiko/TaikoRuleset.cs +++ b/osu.Game.Rulesets.Taiko/TaikoRuleset.cs @@ -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, ScoreInfo scoreInfo) => new TaikoPerformanceCalculator(this, beatmap, scoreInfo); + public override PerformanceCalculator CreatePerformanceCalculator(WorkingBeatmap beatmap, ScoreInfo score) => new TaikoPerformanceCalculator(this, beatmap, score); public override int? LegacyID => 1; diff --git a/osu.Game.Tests/Beatmaps/IO/ImportScoreTest.cs b/osu.Game.Tests/Beatmaps/IO/ImportScoreTest.cs index 274f2a6947..3e7a4424df 100644 --- a/osu.Game.Tests/Beatmaps/IO/ImportScoreTest.cs +++ b/osu.Game.Tests/Beatmaps/IO/ImportScoreTest.cs @@ -121,19 +121,19 @@ namespace osu.Game.Tests.Beatmaps.IO } } - private ScoreInfo loadIntoOsu(OsuGameBase osu, ScoreInfo scoreInfo, string guidOverride = null) + private ScoreInfo loadIntoOsu(OsuGameBase osu, ScoreInfo score, string guidOverride = null) { - scoreInfo.MD5Hash = guidOverride ?? Guid.NewGuid().ToString(); + score.MD5Hash = guidOverride ?? Guid.NewGuid().ToString(); var beatmapManager = osu.Dependencies.Get(); - scoreInfo.BeatmapInfo = beatmapManager.GetAllUsableBeatmapSets().First().Beatmaps.First(); - scoreInfo.Ruleset = new OsuRuleset().RulesetInfo; + score.BeatmapInfo = beatmapManager.GetAllUsableBeatmapSets().First().Beatmaps.First(); + score.Ruleset = new OsuRuleset().RulesetInfo; var scoreManager = osu.Dependencies.Get(); - scoreManager.Import(scoreInfo); + scoreManager.Import(score); - var imported = scoreManager.Query(s => s.MD5Hash == scoreInfo.MD5Hash); + var imported = scoreManager.Query(s => s.MD5Hash == score.MD5Hash); return imported; } diff --git a/osu.Game/OsuGame.cs b/osu.Game/OsuGame.cs index 830cefc58c..7d66bf9cfb 100644 --- a/osu.Game/OsuGame.cs +++ b/osu.Game/OsuGame.cs @@ -248,7 +248,7 @@ namespace osu.Game /// The beatmap to show. public void ShowBeatmap(int beatmapId) => beatmapSetOverlay.FetchAndShowBeatmap(beatmapId); - protected void LoadScore(ScoreInfo scoreInfo) + protected void LoadScore(ScoreInfo score) { scoreLoad?.Cancel(); @@ -256,18 +256,18 @@ namespace osu.Game if (menu == null) { - scoreLoad = Schedule(() => LoadScore(scoreInfo)); + scoreLoad = Schedule(() => LoadScore(score)); return; } if (!menu.IsCurrentScreen) { menu.MakeCurrent(); - this.Delay(500).Schedule(() => LoadScore(scoreInfo), out scoreLoad); + this.Delay(500).Schedule(() => LoadScore(score), out scoreLoad); return; } - var databasedBeatmap = BeatmapManager.QueryBeatmap(b => b.ID == scoreInfo.BeatmapInfo.ID); + var databasedBeatmap = BeatmapManager.QueryBeatmap(b => b.ID == score.BeatmapInfo.ID); if (databasedBeatmap == null) { @@ -279,12 +279,12 @@ namespace osu.Game return; } - ruleset.Value = scoreInfo.Ruleset; + ruleset.Value = score.Ruleset; Beatmap.Value = BeatmapManager.GetWorkingBeatmap(databasedBeatmap); - Beatmap.Value.Mods.Value = scoreInfo.Mods; + Beatmap.Value.Mods.Value = score.Mods; - menu.Push(new PlayerLoader(new ReplayPlayer(ScoreManager.GetScore(scoreInfo).Replay))); + menu.Push(new PlayerLoader(new ReplayPlayer(ScoreManager.GetScore(score).Replay))); } protected override void Dispose(bool isDisposing) diff --git a/osu.Game/Overlays/BeatmapSet/Scores/DrawableScore.cs b/osu.Game/Overlays/BeatmapSet/Scores/DrawableScore.cs index 1b079f33ea..f643e130aa 100644 --- a/osu.Game/Overlays/BeatmapSet/Scores/DrawableScore.cs +++ b/osu.Game/Overlays/BeatmapSet/Scores/DrawableScore.cs @@ -26,7 +26,7 @@ namespace osu.Game.Overlays.BeatmapSet.Scores private readonly Box background; - public DrawableScore(int index, APIScoreInfo scoreInfo) + public DrawableScore(int index, APIScoreInfo score) { ScoreModsContainer modsContainer; @@ -49,7 +49,7 @@ namespace osu.Game.Overlays.BeatmapSet.Scores Font = @"Exo2.0-RegularItalic", Margin = new MarginPadding { Left = side_margin } }, - new DrawableFlag(scoreInfo.User.Country) + new DrawableFlag(score.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 = scoreInfo.User, + User = score.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(scoreInfo.Rank) + new DrawableRank(score.Rank) { Anchor = Anchor.CentreLeft, Origin = Anchor.CentreLeft, @@ -86,7 +86,7 @@ namespace osu.Game.Overlays.BeatmapSet.Scores { Anchor = Anchor.CentreLeft, Origin = Anchor.CentreRight, - Text = $@"{scoreInfo.TotalScore:N0}", + Text = $@"{score.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 = $@"{scoreInfo.Accuracy:P2}", + Text = $@"{score.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 = $"{scoreInfo.Statistics[HitResult.Great]}/{scoreInfo.Statistics[HitResult.Good]}/{scoreInfo.Statistics[HitResult.Meh]}", + Text = $"{score.Statistics[HitResult.Great]}/{score.Statistics[HitResult.Good]}/{score.Statistics[HitResult.Meh]}", Font = @"Exo2.0-RegularItalic", Margin = new MarginPadding { Right = side_margin } }, }; - foreach (Mod mod in scoreInfo.Mods) + foreach (Mod mod in score.Mods) modsContainer.Add(new ModIcon(mod) { AutoSizeAxes = Axes.Both, diff --git a/osu.Game/Overlays/BeatmapSet/Scores/DrawableTopScore.cs b/osu.Game/Overlays/BeatmapSet/Scores/DrawableTopScore.cs index b5e008d5da..643839fa88 100644 --- a/osu.Game/Overlays/BeatmapSet/Scores/DrawableTopScore.cs +++ b/osu.Game/Overlays/BeatmapSet/Scores/DrawableTopScore.cs @@ -43,26 +43,26 @@ namespace osu.Game.Overlays.BeatmapSet.Scores private readonly InfoColumn statistics; private readonly ScoreModsContainer modsContainer; - private APIScoreInfo scoreInfo; - public APIScoreInfo ScoreInfo + private APIScoreInfo score; + public APIScoreInfo Score { - get { return scoreInfo; } + get { return score; } set { - if (scoreInfo == value) return; - scoreInfo = value; + if (score == value) return; + score = value; - avatar.User = username.User = scoreInfo.User; - flag.Country = scoreInfo.User.Country; - date.Text = $@"achieved {scoreInfo.Date:MMM d, yyyy}"; - rank.UpdateRank(scoreInfo.Rank); + avatar.User = username.User = score.User; + flag.Country = score.User.Country; + date.Text = $@"achieved {score.Date:MMM d, yyyy}"; + rank.UpdateRank(score.Rank); - totalScore.Value = $@"{scoreInfo.TotalScore:N0}"; - accuracy.Value = $@"{scoreInfo.Accuracy:P2}"; - statistics.Value = $"{scoreInfo.Statistics[HitResult.Great]}/{scoreInfo.Statistics[HitResult.Good]}/{scoreInfo.Statistics[HitResult.Meh]}"; + totalScore.Value = $@"{score.TotalScore:N0}"; + accuracy.Value = $@"{score.Accuracy:P2}"; + statistics.Value = $"{score.Statistics[HitResult.Great]}/{score.Statistics[HitResult.Good]}/{score.Statistics[HitResult.Meh]}"; modsContainer.Clear(); - foreach (Mod mod in scoreInfo.Mods) + foreach (Mod mod in score.Mods) modsContainer.Add(new ModIcon(mod) { AutoSizeAxes = Axes.Both, diff --git a/osu.Game/Overlays/BeatmapSet/Scores/ScoresContainer.cs b/osu.Game/Overlays/BeatmapSet/Scores/ScoresContainer.cs index f2ffea9ae6..e338d2f90f 100644 --- a/osu.Game/Overlays/BeatmapSet/Scores/ScoresContainer.cs +++ b/osu.Game/Overlays/BeatmapSet/Scores/ScoresContainer.cs @@ -80,7 +80,7 @@ namespace osu.Game.Overlays.BeatmapSet.Scores return; } - topScore.ScoreInfo = scores.FirstOrDefault(); + topScore.Score = scores.FirstOrDefault(); topScore.Show(); flow.Clear(); diff --git a/osu.Game/Overlays/Profile/Sections/Ranks/DrawablePerformanceScore.cs b/osu.Game/Overlays/Profile/Sections/Ranks/DrawablePerformanceScore.cs index a4f05b0f96..98a4bdba45 100644 --- a/osu.Game/Overlays/Profile/Sections/Ranks/DrawablePerformanceScore.cs +++ b/osu.Game/Overlays/Profile/Sections/Ranks/DrawablePerformanceScore.cs @@ -13,8 +13,8 @@ namespace osu.Game.Overlays.Profile.Sections.Ranks { private readonly double? weight; - public DrawablePerformanceScore(ScoreInfo scoreInfo, double? weight = null) - : base(scoreInfo) + public DrawablePerformanceScore(ScoreInfo score, double? weight = null) + : base(score) { this.weight = weight; } @@ -22,7 +22,7 @@ namespace osu.Game.Overlays.Profile.Sections.Ranks [BackgroundDependencyLoader] private void load(OsuColour colour) { - double pp = ScoreInfo.PP ?? 0; + double pp = Score.PP ?? 0; RightFlowContainer.Add(new OsuSpriteText { Text = $"{pp:0}pp", diff --git a/osu.Game/Overlays/Profile/Sections/Ranks/DrawableProfileScore.cs b/osu.Game/Overlays/Profile/Sections/Ranks/DrawableProfileScore.cs index a74d6ca35e..c3180a1abe 100644 --- a/osu.Game/Overlays/Profile/Sections/Ranks/DrawableProfileScore.cs +++ b/osu.Game/Overlays/Profile/Sections/Ranks/DrawableProfileScore.cs @@ -16,11 +16,11 @@ namespace osu.Game.Overlays.Profile.Sections.Ranks public abstract class DrawableProfileScore : DrawableProfileRow { private readonly ScoreModsContainer modsContainer; - protected readonly ScoreInfo ScoreInfo; + protected readonly ScoreInfo Score; - protected DrawableProfileScore(ScoreInfo scoreInfo) + protected DrawableProfileScore(ScoreInfo score) { - ScoreInfo = scoreInfo; + Score = score; RelativeSizeAxes = Axes.X; Height = 60; @@ -42,7 +42,7 @@ namespace osu.Game.Overlays.Profile.Sections.Ranks { var text = new OsuSpriteText { - Text = $"accuracy: {ScoreInfo.Accuracy:P2}", + Text = $"accuracy: {Score.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(ScoreInfo.BeatmapInfo)); - LeftFlowContainer.Add(new DrawableDate(ScoreInfo.Date)); + LeftFlowContainer.Add(new BeatmapMetadataContainer(Score.BeatmapInfo)); + LeftFlowContainer.Add(new DrawableDate(Score.Date)); - foreach (Mod mod in ScoreInfo.Mods) + foreach (Mod mod in Score.Mods) modsContainer.Add(new ModIcon(mod) { Scale = new Vector2(0.5f) }); } - protected override Drawable CreateLeftVisual() => new DrawableRank(ScoreInfo.Rank) + protected override Drawable CreateLeftVisual() => new DrawableRank(Score.Rank) { RelativeSizeAxes = Axes.Y, Width = 60, diff --git a/osu.Game/Overlays/Profile/Sections/Ranks/DrawableTotalScore.cs b/osu.Game/Overlays/Profile/Sections/Ranks/DrawableTotalScore.cs index 268ba57b75..a48468e4e5 100644 --- a/osu.Game/Overlays/Profile/Sections/Ranks/DrawableTotalScore.cs +++ b/osu.Game/Overlays/Profile/Sections/Ranks/DrawableTotalScore.cs @@ -10,8 +10,8 @@ namespace osu.Game.Overlays.Profile.Sections.Ranks { public class DrawableTotalScore : DrawableProfileScore { - public DrawableTotalScore(ScoreInfo scoreInfo) - : base(scoreInfo) + public DrawableTotalScore(ScoreInfo score) + : base(score) { } @@ -20,7 +20,7 @@ namespace osu.Game.Overlays.Profile.Sections.Ranks { RightFlowContainer.Add(new OsuSpriteText { - Text = ScoreInfo.TotalScore.ToString("#,###"), + Text = Score.TotalScore.ToString("#,###"), Anchor = Anchor.TopRight, Origin = Anchor.TopRight, TextSize = 18, diff --git a/osu.Game/Rulesets/Difficulty/PerformanceCalculator.cs b/osu.Game/Rulesets/Difficulty/PerformanceCalculator.cs index 8b1a54fc7c..48a68928de 100644 --- a/osu.Game/Rulesets/Difficulty/PerformanceCalculator.cs +++ b/osu.Game/Rulesets/Difficulty/PerformanceCalculator.cs @@ -17,21 +17,21 @@ namespace osu.Game.Rulesets.Difficulty protected readonly Ruleset Ruleset; protected readonly IBeatmap Beatmap; - protected readonly ScoreInfo ScoreInfo; + protected readonly ScoreInfo Score; protected double TimeRate { get; private set; } = 1; - protected PerformanceCalculator(Ruleset ruleset, WorkingBeatmap beatmap, ScoreInfo scoreInfo) + protected PerformanceCalculator(Ruleset ruleset, WorkingBeatmap beatmap, ScoreInfo score) { Ruleset = ruleset; - ScoreInfo = scoreInfo; + Score = score; - beatmap.Mods.Value = scoreInfo.Mods; + beatmap.Mods.Value = score.Mods; Beatmap = beatmap.GetPlayableBeatmap(ruleset.RulesetInfo); - Attributes = ruleset.CreateDifficultyCalculator(beatmap).Calculate(scoreInfo.Mods); + Attributes = ruleset.CreateDifficultyCalculator(beatmap).Calculate(score.Mods); - ApplyMods(scoreInfo.Mods); + ApplyMods(score.Mods); } protected virtual void ApplyMods(Mod[] mods) diff --git a/osu.Game/Rulesets/Ruleset.cs b/osu.Game/Rulesets/Ruleset.cs index 86bd6d9072..53e3e40374 100644 --- a/osu.Game/Rulesets/Ruleset.cs +++ b/osu.Game/Rulesets/Ruleset.cs @@ -73,7 +73,7 @@ namespace osu.Game.Rulesets public abstract DifficultyCalculator CreateDifficultyCalculator(WorkingBeatmap beatmap); - public virtual PerformanceCalculator CreatePerformanceCalculator(WorkingBeatmap beatmap, ScoreInfo scoreInfo) => null; + public virtual PerformanceCalculator CreatePerformanceCalculator(WorkingBeatmap beatmap, ScoreInfo score) => null; public virtual HitObjectComposer CreateHitObjectComposer() => null; diff --git a/osu.Game/Rulesets/Scoring/ScoreProcessor.cs b/osu.Game/Rulesets/Scoring/ScoreProcessor.cs index 632ebcec6b..830f13ad6d 100644 --- a/osu.Game/Rulesets/Scoring/ScoreProcessor.cs +++ b/osu.Game/Rulesets/Scoring/ScoreProcessor.cs @@ -158,15 +158,15 @@ namespace osu.Game.Rulesets.Scoring /// /// Retrieve a score populated with data for the current play this processor is responsible for. /// - public virtual void PopulateScore(ScoreInfo scoreInfo) + public virtual void PopulateScore(ScoreInfo score) { - scoreInfo.TotalScore = TotalScore; - scoreInfo.Combo = Combo; - scoreInfo.MaxCombo = HighestCombo; - scoreInfo.Accuracy = Accuracy; - scoreInfo.Rank = Rank; - scoreInfo.Date = DateTimeOffset.Now; - scoreInfo.Health = Health; + score.TotalScore = TotalScore; + score.Combo = Combo; + score.MaxCombo = HighestCombo; + score.Accuracy = Accuracy; + score.Rank = Rank; + score.Date = DateTimeOffset.Now; + score.Health = Health; } } diff --git a/osu.Game/Scoring/LegacyDatabasedScore.cs b/osu.Game/Scoring/LegacyDatabasedScore.cs index 29996d5c01..768c5da7af 100644 --- a/osu.Game/Scoring/LegacyDatabasedScore.cs +++ b/osu.Game/Scoring/LegacyDatabasedScore.cs @@ -12,11 +12,11 @@ namespace osu.Game.Scoring { public class LegacyDatabasedScore : Score { - public LegacyDatabasedScore(ScoreInfo scoreInfo, RulesetStore rulesets, BeatmapManager beatmaps, IResourceStore store) + public LegacyDatabasedScore(ScoreInfo score, RulesetStore rulesets, BeatmapManager beatmaps, IResourceStore store) { - ScoreInfo = scoreInfo; + ScoreInfo = score; - var replayFilename = scoreInfo.Files.First(f => f.Filename.EndsWith(".osr", StringComparison.InvariantCultureIgnoreCase)).FileInfo.StoragePath; + var replayFilename = score.Files.First(f => f.Filename.EndsWith(".osr", StringComparison.InvariantCultureIgnoreCase)).FileInfo.StoragePath; using (var stream = store.GetStream(replayFilename)) Replay = new DatabasedLegacyScoreParser(rulesets, beatmaps).Parse(stream).Replay; diff --git a/osu.Game/Scoring/ScoreManager.cs b/osu.Game/Scoring/ScoreManager.cs index 5eedf3bcf8..5d16d40346 100644 --- a/osu.Game/Scoring/ScoreManager.cs +++ b/osu.Game/Scoring/ScoreManager.cs @@ -67,7 +67,7 @@ namespace osu.Game.Scoring return null; } - public Score GetScore(ScoreInfo scoreInfo) => new LegacyDatabasedScore(scoreInfo, rulesets, beatmaps, Files.Store); + public Score GetScore(ScoreInfo score) => new LegacyDatabasedScore(score, rulesets, beatmaps, Files.Store); public List GetAllUsableScores() => ModelStore.ConsumableItems.Where(s => !s.DeletePending).ToList(); diff --git a/osu.Game/Screens/Ranking/Results.cs b/osu.Game/Screens/Ranking/Results.cs index 89674c1ed0..1ff5fc7bfd 100644 --- a/osu.Game/Screens/Ranking/Results.cs +++ b/osu.Game/Screens/Ranking/Results.cs @@ -23,7 +23,7 @@ namespace osu.Game.Screens.Ranking { public class Results : OsuScreen { - private readonly ScoreInfo scoreInfo; + private readonly ScoreInfo score; 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(ScoreInfo scoreInfo) + public Results(ScoreInfo score) { - this.scoreInfo = scoreInfo; + this.score = score; } private const float transition_time = 800; @@ -188,7 +188,7 @@ namespace osu.Game.Screens.Ranking }, new OsuSpriteText { - Text = $"{scoreInfo.MaxCombo}x", + Text = $"{score.MaxCombo}x", TextSize = 40, RelativePositionAxes = Axes.X, Font = @"Exo2.0-Bold", @@ -209,7 +209,7 @@ namespace osu.Game.Screens.Ranking }, new OsuSpriteText { - Text = $"{scoreInfo.Accuracy:P2}", + Text = $"{score.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(scoreInfo, Beatmap.Value); + currentPage = new ResultsPageScore(score, Beatmap.Value); break; case ResultMode.Ranking: - currentPage = new ResultsPageRanking(scoreInfo, Beatmap.Value); + currentPage = new ResultsPageRanking(score, Beatmap.Value); break; } diff --git a/osu.Game/Screens/Ranking/ResultsPage.cs b/osu.Game/Screens/Ranking/ResultsPage.cs index eb09ceb574..5f68623e54 100644 --- a/osu.Game/Screens/Ranking/ResultsPage.cs +++ b/osu.Game/Screens/Ranking/ResultsPage.cs @@ -16,16 +16,16 @@ namespace osu.Game.Screens.Ranking { public class ResultsPage : Container { - protected readonly ScoreInfo ScoreInfo; + protected readonly ScoreInfo Score; protected readonly WorkingBeatmap Beatmap; private CircularContainer content; private Box fill; protected override Container Content => content; - public ResultsPage(ScoreInfo scoreInfo, WorkingBeatmap beatmap) + public ResultsPage(ScoreInfo score, WorkingBeatmap beatmap) { - ScoreInfo = scoreInfo; + Score = score; Beatmap = beatmap; RelativeSizeAxes = Axes.Both; } diff --git a/osu.Game/Screens/Ranking/ResultsPageRanking.cs b/osu.Game/Screens/Ranking/ResultsPageRanking.cs index 235aa632cd..6db34fc071 100644 --- a/osu.Game/Screens/Ranking/ResultsPageRanking.cs +++ b/osu.Game/Screens/Ranking/ResultsPageRanking.cs @@ -14,7 +14,7 @@ namespace osu.Game.Screens.Ranking { public class ResultsPageRanking : ResultsPage { - public ResultsPageRanking(ScoreInfo scoreInfo, WorkingBeatmap beatmap = null) : base(scoreInfo, beatmap) + public ResultsPageRanking(ScoreInfo score, WorkingBeatmap beatmap = null) : base(score, beatmap) { } @@ -33,7 +33,7 @@ namespace osu.Game.Screens.Ranking Origin = Anchor.Centre, Anchor = Anchor.Centre, RelativeSizeAxes = Axes.Both, - Beatmap = Beatmap.BeatmapInfo ?? ScoreInfo.BeatmapInfo, + Beatmap = Beatmap.BeatmapInfo ?? Score.BeatmapInfo, Scale = new Vector2(0.7f) } }; diff --git a/osu.Game/Screens/Ranking/ResultsPageScore.cs b/osu.Game/Screens/Ranking/ResultsPageScore.cs index 6641ccaf8c..153d154d40 100644 --- a/osu.Game/Screens/Ranking/ResultsPageScore.cs +++ b/osu.Game/Screens/Ranking/ResultsPageScore.cs @@ -33,7 +33,7 @@ namespace osu.Game.Screens.Ranking private Container scoreContainer; private ScoreCounter scoreCounter; - public ResultsPageScore(ScoreInfo scoreInfo, WorkingBeatmap beatmap) : base(scoreInfo, beatmap) { } + public ResultsPageScore(ScoreInfo score, WorkingBeatmap beatmap) : base(score, beatmap) { } private FillFlowContainer statisticsContainer; @@ -64,14 +64,14 @@ namespace osu.Game.Screens.Ranking Direction = FillDirection.Vertical, Children = new Drawable[] { - new UserHeader(ScoreInfo.User) + new UserHeader(Score.User) { Anchor = Anchor.TopCentre, Origin = Anchor.TopCentre, RelativeSizeAxes = Axes.X, Height = user_header_height, }, - new DrawableRank(ScoreInfo.Rank) + new DrawableRank(Score.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(ScoreInfo.Date.LocalDateTime) + new DateTimeDisplay(Score.Date.LocalDateTime) { Anchor = Anchor.TopCentre, Origin = Anchor.TopCentre, @@ -166,7 +166,7 @@ namespace osu.Game.Screens.Ranking } }; - statisticsContainer.ChildrenEnumerable = ScoreInfo.Statistics.OrderByDescending(p => p.Key).Select(s => new DrawableScoreStatistic(s)); + statisticsContainer.ChildrenEnumerable = Score.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(ScoreInfo.TotalScore); + scoreCounter.Increment(Score.TotalScore); int delay = 0; foreach (var s in statisticsContainer.Children) diff --git a/osu.Game/Screens/Select/Leaderboards/LeaderboardScore.cs b/osu.Game/Screens/Select/Leaderboards/LeaderboardScore.cs index 4356deeb94..1ba529c0bf 100644 --- a/osu.Game/Screens/Select/Leaderboards/LeaderboardScore.cs +++ b/osu.Game/Screens/Select/Leaderboards/LeaderboardScore.cs @@ -25,7 +25,7 @@ namespace osu.Game.Screens.Select.Leaderboards public static readonly float HEIGHT = 60; public readonly int RankPosition; - public readonly ScoreInfo ScoreInfo; + public readonly ScoreInfo Score; 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 modsContainer; - public LeaderboardScore(ScoreInfo scoreInfo, int rank) + public LeaderboardScore(ScoreInfo score, int rank) { - ScoreInfo = scoreInfo; + Score = score; RankPosition = rank; RelativeSizeAxes = Axes.X; @@ -102,7 +102,7 @@ namespace osu.Game.Screens.Select.Leaderboards Children = new[] { avatar = new DelayedLoadWrapper( - new Avatar(ScoreInfo.User) + new Avatar(Score.User) { RelativeSizeAxes = Axes.Both, CornerRadius = corner_radius, @@ -128,7 +128,7 @@ namespace osu.Game.Screens.Select.Leaderboards { nameLabel = new OsuSpriteText { - Text = ScoreInfo.User.Username, + Text = Score.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(ScoreInfo.User?.Country) + new DrawableFlag(Score.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, ScoreInfo.MaxCombo.ToString(), "Max Combo"), - accuracy = new ScoreComponentLabel(FontAwesome.fa_crosshairs, string.Format(ScoreInfo.Accuracy % 1 == 0 ? @"{0:P0}" : @"{0:P2}", ScoreInfo.Accuracy), "Accuracy"), + 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"), }, }, }, @@ -183,13 +183,13 @@ namespace osu.Game.Screens.Select.Leaderboards Spacing = new Vector2(5f, 0f), Children = new Drawable[] { - scoreLabel = new GlowingSpriteText(ScoreInfo.TotalScore.ToString(@"N0"), @"Venera", 23, Color4.White, OsuColour.FromHex(@"83ccfa")), + scoreLabel = new GlowingSpriteText(Score.TotalScore.ToString(@"N0"), @"Venera", 23, Color4.White, OsuColour.FromHex(@"83ccfa")), new Container { Size = new Vector2(40f, 20f), Children = new[] { - scoreRank = new DrawableRank(ScoreInfo.Rank) + scoreRank = new DrawableRank(Score.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 = ScoreInfo.Mods.Select(mod => new ModIcon(mod) { Scale = new Vector2(0.375f) }) + ChildrenEnumerable = Score.Mods.Select(mod => new ModIcon(mod) { Scale = new Vector2(0.375f) }) }, }, },