Add ruleset-specific checker

This commit is contained in:
Naxess 2021-04-07 14:36:43 +02:00
parent b24ce66a0d
commit 0343ef7f14
3 changed files with 34 additions and 0 deletions

View File

@ -0,0 +1,30 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using System.Collections.Generic;
using System.Linq;
using osu.Game.Beatmaps;
using osu.Game.Rulesets.Edit;
using osu.Game.Rulesets.Osu.Edit.Checks;
using osu.Game.Screens.Edit.Verify.Components;
namespace osu.Game.Rulesets.Osu.Edit
{
public class OsuChecker : Checker
{
public readonly List<BeatmapCheck> beatmapChecks = new List<BeatmapCheck>
{
new CheckConsecutiveCircles()
};
public override IEnumerable<Issue> Run(IBeatmap beatmap)
{
// Also run mode-invariant checks.
foreach (var issue in base.Run(beatmap))
yield return issue;
foreach (var issue in beatmapChecks.SelectMany(check => check.Run(beatmap)))
yield return issue;
}
}
}

View File

@ -206,6 +206,8 @@ public override IEnumerable<Mod> GetModsFor(ModType type)
public override HitObjectComposer CreateHitObjectComposer() => new OsuHitObjectComposer(this);
public override Checker CreateChecker() => new OsuChecker();
public override string Description => "osu!";
public override string ShortName => SHORT_NAME;

View File

@ -202,6 +202,8 @@ public PerformanceCalculator CreatePerformanceCalculator(WorkingBeatmap beatmap,
public virtual HitObjectComposer CreateHitObjectComposer() => null;
public virtual Checker CreateChecker() => null;
public virtual Drawable CreateIcon() => new SpriteIcon { Icon = FontAwesome.Solid.QuestionCircle };
public virtual IResourceStore<byte[]> CreateResourceStore() => new NamespacedResourceStore<byte[]>(new DllResourceStore(GetType().Assembly), @"Resources");