1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-13 12:53:11 +08:00

Move enums out of nesting

This commit is contained in:
Dean Herbert 2021-04-12 15:32:52 +09:00
parent 3551322f1d
commit f78239c7f2
7 changed files with 73 additions and 63 deletions

View File

@ -24,7 +24,7 @@ namespace osu.Game.Rulesets.Osu.Edit.Checks
public override CheckMetadata Metadata() => new CheckMetadata
(
category: CheckMetadata.CheckCategory.Compose,
category: CheckCategory.Compose,
description: "Offscreen hitobjects."
);
@ -36,13 +36,13 @@ namespace osu.Game.Rulesets.Osu.Edit.Checks
private readonly IssueTemplate templateOffscreen = new IssueTemplate
(
type: IssueTemplate.IssueType.Problem,
type: IssueType.Problem,
unformattedMessage: "This object goes offscreen on a 4:3 aspect ratio."
);
private readonly IssueTemplate templateOffscreenSliderPath = new IssueTemplate
(
type: IssueTemplate.IssueType.Problem,
type: IssueType.Problem,
unformattedMessage: "This slider goes offscreen here on a 4:3 aspect ratio."
);

View File

@ -12,7 +12,7 @@ namespace osu.Game.Rulesets.Edit.Checks
{
public override CheckMetadata Metadata() => new CheckMetadata
(
category: CheckMetadata.CheckCategory.Resources,
category: CheckCategory.Resources,
description: "Missing background."
);
@ -24,13 +24,13 @@ namespace osu.Game.Rulesets.Edit.Checks
private readonly IssueTemplate templateNoneSet = new IssueTemplate
(
type: IssueTemplate.IssueType.Problem,
type: IssueType.Problem,
unformattedMessage: "No background has been set."
);
private readonly IssueTemplate templateDoesNotExist = new IssueTemplate
(
type: IssueTemplate.IssueType.Problem,
type: IssueType.Problem,
unformattedMessage: "The background file \"{0}\" is does not exist."
);

View File

@ -0,0 +1,41 @@
// 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.
namespace osu.Game.Rulesets.Edit.Checks.Components
{
/// <summary>
/// The category of an issue.
/// </summary>
public enum CheckCategory
{
/// <summary> Anything to do with control points. </summary>
Timing,
/// <summary> Anything to do with artist, title, creator, etc. </summary>
Metadata,
/// <summary> Anything to do with non-audio files, e.g. background, skin, sprites, and video. </summary>
Resources,
/// <summary> Anything to do with audio files, e.g. song and hitsounds. </summary>
Audio,
/// <summary> Anything to do with files that don't fit into the above, e.g. unused, osu, or osb. </summary>
Files,
/// <summary> Anything to do with hitobjects unrelated to spread. </summary>
Compose,
/// <summary> Anything to do with difficulty levels or their progression. </summary>
Spread,
/// <summary> Anything to do with variables like CS, OD, AR, HP, and global SV. </summary>
Settings,
/// <summary> Anything to do with hitobject feedback. </summary>
Hitsounds,
/// <summary> Anything to do with storyboarding, breaks, video offset, etc. </summary>
Events
}
}

View File

@ -5,42 +5,6 @@ namespace osu.Game.Rulesets.Edit.Checks.Components
{
public class CheckMetadata
{
/// <summary>
/// The category of an issue.
/// </summary>
public enum CheckCategory
{
/// <summary> Anything to do with control points. </summary>
Timing,
/// <summary> Anything to do with artist, title, creator, etc. </summary>
Metadata,
/// <summary> Anything to do with non-audio files, e.g. background, skin, sprites, and video. </summary>
Resources,
/// <summary> Anything to do with audio files, e.g. song and hitsounds. </summary>
Audio,
/// <summary> Anything to do with files that don't fit into the above, e.g. unused, osu, or osb. </summary>
Files,
/// <summary> Anything to do with hitobjects unrelated to spread. </summary>
Compose,
/// <summary> Anything to do with difficulty levels or their progression. </summary>
Spread,
/// <summary> Anything to do with variables like CS, OD, AR, HP, and global SV. </summary>
Settings,
/// <summary> Anything to do with hitobject feedback. </summary>
Hitsounds,
/// <summary> Anything to do with storyboarding, breaks, video offset, etc. </summary>
Events
}
/// <summary>
/// The category this check belongs to. E.g. <see cref="CheckCategory.Metadata"/>, <see cref="CheckCategory.Timing"/>, or <see cref="CheckCategory.Compose"/>.
/// </summary>

View File

@ -22,7 +22,7 @@ namespace osu.Game.Rulesets.Edit.Checks.Components
public IReadOnlyList<HitObject> HitObjects;
/// <summary>
/// The template which this issue is using. This provides properties such as the <see cref="IssueTemplate.IssueType"/>, and the <see cref="IssueTemplate.UnformattedMessage"/>.
/// The template which this issue is using. This provides properties such as the <see cref="IssueType"/>, and the <see cref="IssueTemplate.UnformattedMessage"/>.
/// </summary>
public IssueTemplate Template;

View File

@ -14,26 +14,6 @@ namespace osu.Game.Rulesets.Edit.Checks.Components
private static readonly Color4 negligible_green = new Colour4(0.33f, 0.8f, 0.5f, 1.0f);
private static readonly Color4 error_gray = new Colour4(0.5f, 0.5f, 0.5f, 1.0f);
/// <summary>
/// The type, or severity, of an issue. This decides its priority.
/// </summary>
public enum IssueType
{
/// <summary> A must-fix in the vast majority of cases. </summary>
Problem = 3,
/// <summary> A possible mistake. Often requires critical thinking. </summary>
Warning = 2,
// TODO: Try/catch all checks run and return error templates if exceptions occur.
/// <summary> An error occurred and a complete check could not be made. </summary>
Error = 1,
// TODO: Negligible issues should be hidden by default.
/// <summary> A possible mistake so minor/unlikely that it can often be safely ignored. </summary>
Negligible = 0,
}
/// <summary>
/// The check that this template originates from.
/// </summary>

View File

@ -0,0 +1,25 @@
// 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.
namespace osu.Game.Rulesets.Edit.Checks.Components
{
/// <summary>
/// The type, or severity, of an issue. This decides its priority.
/// </summary>
public enum IssueType
{
/// <summary> A must-fix in the vast majority of cases. </summary>
Problem = 3,
/// <summary> A possible mistake. Often requires critical thinking. </summary>
Warning = 2,
// TODO: Try/catch all checks run and return error templates if exceptions occur.
/// <summary> An error occurred and a complete check could not be made. </summary>
Error = 1,
// TODO: Negligible issues should be hidden by default.
/// <summary> A possible mistake so minor/unlikely that it can often be safely ignored. </summary>
Negligible = 0,
}
}