From 14b8e9fd775914861f1f48c8ced7f71d63876797 Mon Sep 17 00:00:00 2001 From: Jorolf Date: Thu, 21 Sep 2017 22:15:42 +0200 Subject: [PATCH] remove some redundant stuff --- .../Overlays/Profile/Sections/RanksSection.cs | 17 +++-------------- osu.Game/Tests/Visual/TestCaseUserRanks.cs | 6 +----- 2 files changed, 4 insertions(+), 19 deletions(-) diff --git a/osu.Game/Overlays/Profile/Sections/RanksSection.cs b/osu.Game/Overlays/Profile/Sections/RanksSection.cs index b6c56f5cb1..d5ee379a5b 100644 --- a/osu.Game/Overlays/Profile/Sections/RanksSection.cs +++ b/osu.Game/Overlays/Profile/Sections/RanksSection.cs @@ -8,15 +8,14 @@ using osu.Game.Graphics.Sprites; using osu.Game.Overlays.Profile.Sections.Ranks; using osu.Game.Rulesets.Scoring; using System; -using System.Collections.Generic; using System.Linq; -using osu.Framework.Allocation; using osu.Game.Online.API; using osu.Game.Online.API.Requests; using osu.Game.Rulesets; using osu.Game.Users; using osu.Game.Graphics.UserInterface; using OpenTK; +using osu.Framework.Allocation; namespace osu.Game.Overlays.Profile.Sections { @@ -28,9 +27,6 @@ namespace osu.Game.Overlays.Profile.Sections private readonly ScoreContainer best, first; - private APIAccess api; - private RulesetStore rulesets; - public RanksSection() { Children = new Drawable[] @@ -40,13 +36,6 @@ namespace osu.Game.Overlays.Profile.Sections }; } - [BackgroundDependencyLoader] - private void load(APIAccess api, RulesetStore rulesets) - { - this.api = api; - this.rulesets = rulesets; - } - public override User User { get @@ -69,7 +58,7 @@ namespace osu.Game.Overlays.Profile.Sections private readonly OsuHoverContainer showMoreButton; private readonly LoadingAnimation showMoreLoading; - private ScoreType type; + private readonly ScoreType type; private int visiblePages; private User user; private readonly bool includeWeigth; @@ -166,7 +155,7 @@ namespace osu.Game.Overlays.Profile.Sections if (scores.Any()) { missing.Hide(); - foreach (Score score in scores) + foreach (OnlineScore score in scores) scoreContainer.Add(new DrawableScore(score, includeWeigth ? Math.Pow(0.95, scoreContainer.Count) : -1) { RelativeSizeAxes = Axes.X, diff --git a/osu.Game/Tests/Visual/TestCaseUserRanks.cs b/osu.Game/Tests/Visual/TestCaseUserRanks.cs index e164426a4e..9667897a7d 100644 --- a/osu.Game/Tests/Visual/TestCaseUserRanks.cs +++ b/osu.Game/Tests/Visual/TestCaseUserRanks.cs @@ -4,13 +4,9 @@ using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Shapes; -using osu.Framework.Testing; -using osu.Game.Beatmaps; using osu.Game.Graphics; using osu.Game.Overlays.Profile.Sections; using osu.Game.Overlays.Profile.Sections.Ranks; -using osu.Game.Rulesets.Mods; -using osu.Game.Rulesets.Scoring; using osu.Game.Users; using System; using System.Collections.Generic; @@ -21,7 +17,7 @@ namespace osu.Game.Tests.Visual { public override string Description => "showing your latest achievements"; - public override IReadOnlyList RequiredTypes => new Type[] { typeof(DrawableScore), typeof(RanksSection) }; + public override IReadOnlyList RequiredTypes => new[] { typeof(DrawableScore), typeof(RanksSection) }; public TestCaseUserRanks() {