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
|
|
|
|
|
{
|
2018-07-21 03:22:46 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Cannot determine validity; not valid.
|
|
|
|
|
/// </summary>
|
2017-05-28 04:17:53 +00:00
|
|
|
|
Indeterminate = -2,
|
2018-07-21 03:22:46 +00:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Definitively not valid.
|
|
|
|
|
/// </summary>
|
2017-05-28 04:17:53 +00:00
|
|
|
|
Invalid = -1,
|
2018-07-21 03:22:46 +00:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Suspicious values, but still valid.
|
|
|
|
|
/// </summary>
|
2017-05-28 04:17:53 +00:00
|
|
|
|
Fishy = 0,
|
2018-07-21 03:22:46 +00:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Values are valid.
|
|
|
|
|
/// </summary>
|
2017-05-28 04:17:53 +00:00
|
|
|
|
Valid = 1,
|
|
|
|
|
}
|
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)
|
|
|
|
|
{
|
2018-09-01 21:11:12 +00:00
|
|
|
|
case Severity.Indeterminate: return L_SIndeterminate;
|
|
|
|
|
case Severity.Invalid: return L_SInvalid;
|
|
|
|
|
case Severity.Fishy: return L_SFishy;
|
|
|
|
|
case Severity.Valid: return L_SValid;
|
|
|
|
|
default: return L_SNotImplemented;
|
2017-06-18 01:37:19 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2017-05-28 04:17:53 +00:00
|
|
|
|
}
|