1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-15 14:37:30 +08:00
osu-lazer/osu.Game.Rulesets.Osu/Edit/Checks/CheckOsuAbnormalDifficultySettings.cs

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

46 lines
1.7 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.Osu.Edit.Checks
{
public class CheckOsuAbnormalDifficultySettings : CheckAbnormalDifficultySettings
{
public override CheckMetadata Metadata => new CheckMetadata(CheckCategory.Settings, "Checks osu relevant settings");
2024-03-26 17:55:49 +08:00
2024-03-23 01:48:22 +08:00
public override IEnumerable<Issue> Run(BeatmapVerifierContext context)
{
var diff = context.Beatmap.Difficulty;
Issue? issue;
2024-03-23 01:48:22 +08:00
if (HasMoreThanOneDecimalPlace("Approach rate", diff.ApproachRate, out issue))
yield return issue;
2024-03-23 01:48:22 +08:00
if (OutOfRange("Approach rate", diff.ApproachRate, out issue))
yield return issue;
2024-03-23 01:48:22 +08:00
if (HasMoreThanOneDecimalPlace("Overall difficulty", diff.OverallDifficulty, out issue))
yield return issue;
2024-03-23 01:48:22 +08:00
if (OutOfRange("Overall difficulty", diff.OverallDifficulty, out issue))
yield return issue;
2024-03-23 01:48:22 +08:00
if (HasMoreThanOneDecimalPlace("Circle size", diff.CircleSize, out issue))
yield return issue;
2024-03-23 01:48:22 +08:00
if (OutOfRange("Circle size", diff.CircleSize, out issue))
yield return issue;
2024-03-23 01:48:22 +08:00
if (HasMoreThanOneDecimalPlace("Drain rate", diff.DrainRate, out issue))
yield return issue;
2024-03-23 01:48:22 +08:00
if (OutOfRange("Drain rate", diff.DrainRate, out issue))
yield return issue;
2024-03-23 01:48:22 +08:00
}
}
}