1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 17:07:38 +08:00
osu-lazer/osu.Game.Rulesets.Mania/Edit/Checks/CheckKeyCount.cs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

40 lines
1.2 KiB
C#
Raw Normal View History

2024-03-21 02:52:16 +08:00
// 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 osu.Game.Rulesets.Edit;
using osu.Game.Rulesets.Edit.Checks.Components;
namespace osu.Game.Rulesets.Mania.Edit.Checks
{
public class CheckKeyCount : ICheck
{
public CheckMetadata Metadata => new CheckMetadata(CheckCategory.Settings, "Check mania keycount.");
public IEnumerable<IssueTemplate> PossibleTemplates => new IssueTemplate[]
{
new IssueTemplateKeycountTooLow(this),
};
public IEnumerable<Issue> Run(BeatmapVerifierContext context)
{
var diff = context.Beatmap.Difficulty;
if (diff.CircleSize < 4)
{
yield return new IssueTemplateKeycountTooLow(this).Create(diff.CircleSize);
}
}
public class IssueTemplateKeycountTooLow : IssueTemplate
{
public IssueTemplateKeycountTooLow(ICheck check)
: base(check, IssueType.Problem, "Key count is {0} and must be 4 or higher.")
{
}
public Issue Create(float current) => new Issue(this, current);
}
}
}