Merge pull request #24957 from bdach/solo-score-info-get-display-score

Add `GetDisplayScore()` extension for `SoloScoreInfo`
This commit is contained in:
Dean Herbert 2023-09-29 13:09:16 +09:00 committed by GitHub
commit d5472d3524
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -4,6 +4,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
using osu.Game.Online.API.Requests.Responses;
using osu.Game.Rulesets.Scoring;
namespace osu.Game.Scoring.Legacy
@ -16,6 +17,9 @@ namespace osu.Game.Scoring.Legacy
public static long GetDisplayScore(this ScoreInfo scoreInfo, ScoringMode mode)
=> getDisplayScore(scoreInfo.Ruleset.OnlineID, scoreInfo.TotalScore, mode, scoreInfo.MaximumStatistics);
public static long GetDisplayScore(this SoloScoreInfo soloScoreInfo, ScoringMode mode)
=> getDisplayScore(soloScoreInfo.RulesetID, soloScoreInfo.TotalScore, mode, soloScoreInfo.MaximumStatistics);
private static long getDisplayScore(int rulesetId, long score, ScoringMode mode, IReadOnlyDictionary<HitResult, int> maximumStatistics)
{
if (mode == ScoringMode.Standardised)