Replace IWorkingBeatmap arg with BeatmapVerifierContext in checks

This simplifies passing of contextual information by enabling addition without needing to refactor lots of classes.

See next commit for example.
This commit is contained in:
Naxess
2021-05-12 02:29:18 +02:00
parent 4aeaec6ecc
commit c13b93e6f1
16 changed files with 96 additions and 47 deletions

View File

@ -40,6 +40,7 @@ namespace osu.Game.Screens.Edit.Verify
private IBeatmapVerifier rulesetVerifier;
private BeatmapVerifier generalVerifier;
private BeatmapVerifierContext context;
[BackgroundDependencyLoader]
private void load(OverlayColourProvider colours)
@ -57,6 +58,8 @@ namespace osu.Game.Screens.Edit.Verify
InterpretedDifficulty = new Bindable<DifficultyRating>(beatmap.BeatmapInfo.DifficultyRating);
context = new BeatmapVerifierContext(workingBeatmap.Value);
RelativeSizeAxes = Axes.Both;
InternalChildren = new Drawable[]
@ -101,10 +104,10 @@ namespace osu.Game.Screens.Edit.Verify
public void Refresh()
{
var issues = generalVerifier.Run(beatmap, workingBeatmap.Value);
var issues = generalVerifier.Run(beatmap, context);
if (rulesetVerifier != null)
issues = issues.Concat(rulesetVerifier.Run(beatmap, workingBeatmap.Value));
issues = issues.Concat(rulesetVerifier.Run(beatmap, context));
issues = filter(issues);