1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-12 15:22:55 +08:00

Remove ScoreManager.GetTotalScore()

This commit is contained in:
Dan Balasescu 2023-05-18 18:55:10 +09:00
parent 510b8e4c78
commit f3591f83a2
2 changed files with 5 additions and 14 deletions

View File

@ -75,7 +75,7 @@ namespace osu.Game.Scoring
/// <param name="scores">The array of <see cref="ScoreInfo"/>s to reorder.</param> /// <param name="scores">The array of <see cref="ScoreInfo"/>s to reorder.</param>
/// <returns>The given <paramref name="scores"/> ordered by decreasing total score.</returns> /// <returns>The given <paramref name="scores"/> ordered by decreasing total score.</returns>
public IEnumerable<ScoreInfo> OrderByTotalScore(IEnumerable<ScoreInfo> scores) public IEnumerable<ScoreInfo> OrderByTotalScore(IEnumerable<ScoreInfo> scores)
=> scores.OrderByDescending(s => GetTotalScore(s)) => scores.OrderByDescending(s => s.TotalScore)
.ThenBy(s => s.OnlineID) .ThenBy(s => s.OnlineID)
// Local scores may not have an online ID. Fall back to date in these cases. // Local scores may not have an online ID. Fall back to date in these cases.
.ThenBy(s => s.Date); .ThenBy(s => s.Date);
@ -88,7 +88,7 @@ namespace osu.Game.Scoring
/// </remarks> /// </remarks>
/// <param name="score">The <see cref="ScoreInfo"/> to retrieve the bindable for.</param> /// <param name="score">The <see cref="ScoreInfo"/> to retrieve the bindable for.</param>
/// <returns>The bindable containing the total score.</returns> /// <returns>The bindable containing the total score.</returns>
public Bindable<long> GetBindableTotalScore([NotNull] ScoreInfo score) => new TotalScoreBindable(score, this, configManager); public Bindable<long> GetBindableTotalScore([NotNull] ScoreInfo score) => new TotalScoreBindable(score, configManager);
/// <summary> /// <summary>
/// Retrieves a bindable that represents the formatted total score string of a <see cref="ScoreInfo"/>. /// Retrieves a bindable that represents the formatted total score string of a <see cref="ScoreInfo"/>.
@ -100,14 +100,6 @@ namespace osu.Game.Scoring
/// <returns>The bindable containing the formatted total score string.</returns> /// <returns>The bindable containing the formatted total score string.</returns>
public Bindable<string> GetBindableTotalScoreString([NotNull] ScoreInfo score) => new TotalScoreStringBindable(GetBindableTotalScore(score)); public Bindable<string> GetBindableTotalScoreString([NotNull] ScoreInfo score) => new TotalScoreStringBindable(GetBindableTotalScore(score));
/// <summary>
/// Retrieves the total score of a <see cref="ScoreInfo"/> in the given <see cref="ScoringMode"/>.
/// </summary>
/// <param name="score">The <see cref="ScoreInfo"/> to calculate the total score of.</param>
/// <param name="mode">The <see cref="ScoringMode"/> to return the total score as.</param>
/// <returns>The total score.</returns>
public long GetTotalScore([NotNull] ScoreInfo score, ScoringMode mode = ScoringMode.Standardised) => score.GetDisplayScore(mode);
/// <summary> /// <summary>
/// Retrieves the maximum achievable combo for the provided score. /// Retrieves the maximum achievable combo for the provided score.
/// </summary> /// </summary>
@ -126,12 +118,11 @@ namespace osu.Game.Scoring
/// Creates a new <see cref="TotalScoreBindable"/>. /// Creates a new <see cref="TotalScoreBindable"/>.
/// </summary> /// </summary>
/// <param name="score">The <see cref="ScoreInfo"/> to provide the total score of.</param> /// <param name="score">The <see cref="ScoreInfo"/> to provide the total score of.</param>
/// <param name="scoreManager">The <see cref="ScoreManager"/>.</param>
/// <param name="configManager">The config.</param> /// <param name="configManager">The config.</param>
public TotalScoreBindable(ScoreInfo score, ScoreManager scoreManager, OsuConfigManager configManager) public TotalScoreBindable(ScoreInfo score, OsuConfigManager configManager)
{ {
configManager?.BindWith(OsuSetting.ScoreDisplayMode, scoringMode); configManager?.BindWith(OsuSetting.ScoreDisplayMode, scoringMode);
scoringMode.BindValueChanged(mode => Value = scoreManager.GetTotalScore(score, mode.NewValue), true); scoringMode.BindValueChanged(mode => Value = score.GetDisplayScore(mode.NewValue), true);
} }
} }

View File

@ -149,7 +149,7 @@ namespace osu.Game.Screens.Ranking
var score = trackingContainer.Panel.Score; var score = trackingContainer.Panel.Score;
flow.SetLayoutPosition(trackingContainer, scoreManager.GetTotalScore(score)); flow.SetLayoutPosition(trackingContainer, score.TotalScore);
trackingContainer.Show(); trackingContainer.Show();