mirror of
https://github.com/kwsch/PKHeX
synced 2024-12-20 09:23:17 +00:00
fc754b346b
[Language Reference](https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/proposals/csharp-10.0/file-scoped-namespaces) Updates all the files, one less level of indentation. Some small changes were made to API surfaces, renaming `PKM pkm` -> `PKM pk`, and `LegalityAnalysis.pkm` -> `LegalityAnalysis.Entity`
49 lines
1.3 KiB
C#
49 lines
1.3 KiB
C#
using static PKHeX.Core.LegalityCheckStrings;
|
|
|
|
namespace PKHeX.Core;
|
|
|
|
/// <summary> Severity indication of the associated <see cref="CheckResult"/> </summary>
|
|
/// <remarks>
|
|
/// Severity >= <see cref="Valid"/> is green
|
|
/// Severity == <see cref="Fishy"/> is yellow
|
|
/// Severity <= <see cref="Invalid"/> is red
|
|
/// </remarks>
|
|
public enum Severity : sbyte
|
|
{
|
|
/// <summary>
|
|
/// Cannot determine validity; not valid.
|
|
/// </summary>
|
|
Indeterminate = -2,
|
|
|
|
/// <summary>
|
|
/// Definitively not valid.
|
|
/// </summary>
|
|
Invalid = -1,
|
|
|
|
/// <summary>
|
|
/// Suspicious values, but still valid.
|
|
/// </summary>
|
|
Fishy = 0,
|
|
|
|
/// <summary>
|
|
/// Values are valid.
|
|
/// </summary>
|
|
Valid = 1,
|
|
}
|
|
|
|
public static partial class Extensions
|
|
{
|
|
/// <summary>
|
|
/// Converts a Check result Severity determination (Valid/Invalid/etc) to the localized string.
|
|
/// </summary>
|
|
/// <param name="s"><see cref="Severity"/> value to convert to string.</param>
|
|
/// <returns>Localized <see cref="string"/>.</returns>
|
|
public static string Description(this Severity s) => s switch
|
|
{
|
|
Severity.Indeterminate => L_SIndeterminate,
|
|
Severity.Invalid => L_SInvalid,
|
|
Severity.Fishy => L_SFishy,
|
|
Severity.Valid => L_SValid,
|
|
_ => L_SNotImplemented,
|
|
};
|
|
}
|