mirror of
https://github.com/ppy/osu.git
synced 2025-01-13 05:53:10 +08:00
Update ScorePerformanceCalculator code path.
This commit is contained in:
parent
a425cf4a31
commit
cd15f83f85
@ -17,9 +17,6 @@ namespace osu.Game.Scoring
|
||||
{
|
||||
private readonly ConcurrentDictionary<PerformanceCacheLookup, double> performanceCache = new ConcurrentDictionary<PerformanceCacheLookup, double>();
|
||||
|
||||
[Resolved]
|
||||
private BeatmapManager beatmapManager { get; set; }
|
||||
|
||||
[Resolved]
|
||||
private BeatmapDifficultyManager difficultyManager { get; set; }
|
||||
|
||||
@ -45,14 +42,13 @@ namespace osu.Game.Scoring
|
||||
|
||||
private async Task<double> computePerformanceAsync(ScoreInfo score, PerformanceCacheLookup lookupKey, CancellationToken token = default)
|
||||
{
|
||||
var beatmap = beatmapManager.GetWorkingBeatmap(score.Beatmap);
|
||||
var attributes = await difficultyManager.GetDifficultyAsync(score.Beatmap, score.Ruleset, score.Mods, token);
|
||||
|
||||
if (token.IsCancellationRequested)
|
||||
return default;
|
||||
|
||||
var calculator = score.Ruleset.CreateInstance().CreatePerformanceCalculator(beatmap, score, attributes.Attributes);
|
||||
var total = calculator.Calculate();
|
||||
var calculator = score.Ruleset.CreateInstance().CreatePerformanceCalculator(attributes.Attributes, score);
|
||||
var total = calculator?.Calculate() ?? default;
|
||||
|
||||
performanceCache[lookupKey] = total;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user