mirror of
https://github.com/ppy/osu
synced 2025-01-04 13:22:08 +00:00
Add ruleset-specific checker
This commit is contained in:
parent
b24ce66a0d
commit
0343ef7f14
30
osu.Game.Rulesets.Osu/Edit/OsuChecker.cs
Normal file
30
osu.Game.Rulesets.Osu/Edit/OsuChecker.cs
Normal 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;
|
||||
}
|
||||
}
|
||||
}
|
@ -206,6 +206,8 @@ namespace osu.Game.Rulesets.Osu
|
||||
|
||||
public override HitObjectComposer CreateHitObjectComposer() => new OsuHitObjectComposer(this);
|
||||
|
||||
public override Checker CreateChecker() => new OsuChecker();
|
||||
|
||||
public override string Description => "osu!";
|
||||
|
||||
public override string ShortName => SHORT_NAME;
|
||||
|
@ -202,6 +202,8 @@ namespace osu.Game.Rulesets
|
||||
|
||||
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");
|
||||
|
Loading…
Reference in New Issue
Block a user