mirror of https://github.com/ppy/osu
Update ScorePerformanceCalculator code path.
This commit is contained in:
parent
a425cf4a31
commit
cd15f83f85
|
@ -17,9 +17,6 @@ public class ScorePerformanceManager : Component
|
|||
{
|
||||
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 @@ private bool tryGetExisting(ScoreInfo score, out double performance, out Perform
|
|||
|
||||
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