mirror of
https://github.com/ppy/osu.git
synced 2025-01-28 12:23:21 +08:00
Apply beatmap converter mods in PerformanceCalculator
This commit is contained in:
parent
81186f8423
commit
3cd203699b
@ -2,7 +2,9 @@
|
|||||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
using osu.Game.Beatmaps;
|
using osu.Game.Beatmaps;
|
||||||
|
using osu.Game.Rulesets.Mods;
|
||||||
using osu.Game.Rulesets.Objects;
|
using osu.Game.Rulesets.Objects;
|
||||||
|
|
||||||
namespace osu.Game.Rulesets.Scoring
|
namespace osu.Game.Rulesets.Scoring
|
||||||
@ -23,9 +25,15 @@ namespace osu.Game.Rulesets.Scoring
|
|||||||
|
|
||||||
protected PerformanceCalculator(Ruleset ruleset, Beatmap beatmap, Score score)
|
protected PerformanceCalculator(Ruleset ruleset, Beatmap beatmap, Score score)
|
||||||
{
|
{
|
||||||
Beatmap = CreateBeatmapConverter().Convert(beatmap);
|
|
||||||
Score = score;
|
Score = score;
|
||||||
|
|
||||||
|
var converter = CreateBeatmapConverter();
|
||||||
|
|
||||||
|
foreach (var mod in score.Mods.OfType<IApplicableToBeatmapConverter<TObject>>())
|
||||||
|
mod.ApplyToBeatmapConverter(converter);
|
||||||
|
|
||||||
|
Beatmap = converter.Convert(beatmap);
|
||||||
|
|
||||||
var diffCalc = ruleset.CreateDifficultyCalculator(beatmap, score.Mods);
|
var diffCalc = ruleset.CreateDifficultyCalculator(beatmap, score.Mods);
|
||||||
diffCalc.Calculate(attributes);
|
diffCalc.Calculate(attributes);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user