From ac0e6f8d42eface1fead880b79b40cd8db1833ff Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Sat, 22 Dec 2018 15:35:22 +0900 Subject: [PATCH] Fix post-merge issues --- .../Match/Components/MatchLeaderboard.cs | 23 ++++--------- .../Leaderboards/BeatmapLeaderboardScore.cs | 34 ------------------- 2 files changed, 6 insertions(+), 51 deletions(-) delete mode 100644 osu.Game/Screens/Select/Leaderboards/BeatmapLeaderboardScore.cs diff --git a/osu.Game/Screens/Multi/Match/Components/MatchLeaderboard.cs b/osu.Game/Screens/Multi/Match/Components/MatchLeaderboard.cs index 2fbeea4377..d6c7c28840 100644 --- a/osu.Game/Screens/Multi/Match/Components/MatchLeaderboard.cs +++ b/osu.Game/Screens/Multi/Match/Components/MatchLeaderboard.cs @@ -3,16 +3,13 @@ using System; using System.Collections.Generic; -using System.Linq; using Newtonsoft.Json; using osu.Framework.Allocation; using osu.Game.Graphics; using osu.Game.Online.API; using osu.Game.Online.Leaderboards; using osu.Game.Online.Multiplayer; -using osu.Game.Rulesets.Mods; using osu.Game.Scoring; -using osu.Game.Users; namespace osu.Game.Screens.Multi.Match.Components { @@ -53,7 +50,7 @@ namespace osu.Game.Screens.Multi.Match.Components return req; } - protected override LeaderboardScore CreateScoreVisualiser(RoomScore model, int index) => new MatchLeaderboardScore(model, index); + protected override LeaderboardScore CreateDrawableScore(RoomScore model, int index) => new MatchLeaderboardScore(model, index); private class GetRoomScoresRequest : APIRequest> { @@ -68,7 +65,7 @@ namespace osu.Game.Screens.Multi.Match.Components } } - public class MatchLeaderboardScore : LeaderboardScore + public class MatchLeaderboardScore : LeaderboardScore { public MatchLeaderboardScore(RoomScore score, int rank) : base(score, rank) @@ -81,20 +78,12 @@ namespace osu.Game.Screens.Multi.Match.Components RankContainer.Alpha = 0; } - protected override User GetUser(RoomScore model) => model.User; - - protected override IEnumerable GetMods(RoomScore model) => Enumerable.Empty(); // Not implemented yet - - protected override IEnumerable<(FontAwesome icon, string value, string name)> GetStatistics(RoomScore model) => new[] + protected override IEnumerable GetStatistics(ScoreInfo model) => new[] { - (FontAwesome.fa_crosshairs, string.Format(model.Accuracy % 1 == 0 ? @"{0:P0}" : @"{0:P2}", model.Accuracy), "Accuracy"), - (FontAwesome.fa_refresh, model.TotalAttempts.ToString(), "Total Attempts"), - (FontAwesome.fa_check, model.CompletedAttempts.ToString(), "Completed Beatmaps"), + new LeaderboardScoreStatistic(FontAwesome.fa_crosshairs, "Accuracy", string.Format(model.Accuracy % 1 == 0 ? @"{0:P0}" : @"{0:P2}", model.Accuracy)), + new LeaderboardScoreStatistic(FontAwesome.fa_refresh, "Total Attempts", ((RoomScore)model).TotalAttempts.ToString()), + new LeaderboardScoreStatistic(FontAwesome.fa_check, "Completed Beatmaps", ((RoomScore)model).CompletedAttempts.ToString()), }; - - protected override int GetTotalScore(RoomScore model) => model.TotalScore; - - protected override ScoreRank GetRank(RoomScore model) => ScoreRank.S; } public enum MatchLeaderboardScope diff --git a/osu.Game/Screens/Select/Leaderboards/BeatmapLeaderboardScore.cs b/osu.Game/Screens/Select/Leaderboards/BeatmapLeaderboardScore.cs deleted file mode 100644 index 098fff4052..0000000000 --- a/osu.Game/Screens/Select/Leaderboards/BeatmapLeaderboardScore.cs +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) 2007-2018 ppy Pty Ltd . -// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE - -using System.Collections.Generic; -using osu.Game.Graphics; -using osu.Game.Online.Leaderboards; -using osu.Game.Rulesets.Mods; -using osu.Game.Scoring; -using osu.Game.Users; - -namespace osu.Game.Screens.Select.Leaderboards -{ - public class BeatmapLeaderboardScore : LeaderboardScore - { - public BeatmapLeaderboardScore(ScoreInfo score, int rank) - : base(score, rank) - { - } - - protected override User GetUser(ScoreInfo model) => model.User; - - protected override IEnumerable GetMods(ScoreInfo model) => model.Mods; - - protected override IEnumerable<(FontAwesome icon, string value, string name)> GetStatistics(ScoreInfo model) => new[] - { - (FontAwesome.fa_link, model.MaxCombo.ToString(), "Max Combo"), - (FontAwesome.fa_crosshairs, string.Format(model.Accuracy % 1 == 0 ? @"{0:P0}" : @"{0:P2}", model.Accuracy), "Accuracy") - }; - - protected override int GetTotalScore(ScoreInfo model) => model.TotalScore; - - protected override ScoreRank GetRank(ScoreInfo model) => model.Rank; - } -}