2017-06-18 01:37:19 +00:00
|
|
|
|
using static PKHeX.Core.LegalityCheckStrings;
|
|
|
|
|
|
|
|
|
|
namespace PKHeX.Core
|
2017-05-28 04:17:53 +00:00
|
|
|
|
{
|
2017-08-01 00:09:16 +00:00
|
|
|
|
/// <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>
|
2017-05-28 04:17:53 +00:00
|
|
|
|
public enum Severity
|
|
|
|
|
{
|
|
|
|
|
Indeterminate = -2,
|
|
|
|
|
Invalid = -1,
|
|
|
|
|
Fishy = 0,
|
|
|
|
|
Valid = 1,
|
|
|
|
|
NotImplemented = 2,
|
|
|
|
|
}
|
2017-06-18 01:37:19 +00:00
|
|
|
|
|
|
|
|
|
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)
|
|
|
|
|
{
|
|
|
|
|
switch (s)
|
|
|
|
|
{
|
|
|
|
|
case Severity.Indeterminate: return V500;
|
|
|
|
|
case Severity.Invalid: return V501;
|
|
|
|
|
case Severity.Fishy: return V502;
|
|
|
|
|
case Severity.Valid: return V503;
|
|
|
|
|
default: return V504;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2017-05-28 04:17:53 +00:00
|
|
|
|
}
|