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

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

33 lines
1.4 KiB
C#
Raw Normal View History

2024-03-23 01:48:22 +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;
using osu.Game.Rulesets.Edit.Checks.Components;
namespace osu.Game.Rulesets.Mania.Edit.Checks
{
public class CheckManiaAbnormalDifficultySettings : CheckAbnormalDifficultySettings
{
public override CheckMetadata Metadata => new CheckMetadata(CheckCategory.Settings, "Checks mania relevant settings");
public override IEnumerable<Issue> Run(BeatmapVerifierContext context)
{
var diff = context.Beatmap.Difficulty;
if (HasMoreThanOneDecimalPlace(diff.OverallDifficulty))
yield return new IssueTemplateMoreThanOneDecimal(this).Create("Overall difficulty", diff.OverallDifficulty);
if (OutOfRange(diff.OverallDifficulty))
yield return new IssueTemplateOutOfRange(this).Create("Overall difficulty", diff.OverallDifficulty);
if (HasMoreThanOneDecimalPlace(diff.DrainRate))
yield return new IssueTemplateMoreThanOneDecimal(this).Create("Drain rate", diff.DrainRate);
if (OutOfRange(diff.DrainRate))
yield return new IssueTemplateOutOfRange(this).Create("Drain rate", diff.DrainRate);
}
}
}