2022-03-12 17:06:03 -08:00
|
|
|
|
namespace PKHeX.Core;
|
2017-05-27 21:17:53 -07:00
|
|
|
|
|
2022-03-12 17:06:03 -08:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Result of a Legality Check
|
|
|
|
|
/// </summary>
|
|
|
|
|
public sealed record CheckResult(Severity Judgement, string Comment, CheckIdentifier Identifier) : ICheckResult
|
|
|
|
|
{
|
|
|
|
|
public bool Valid => Judgement >= Severity.Fishy;
|
|
|
|
|
public string Rating => Judgement.Description();
|
2018-08-02 20:11:42 -07:00
|
|
|
|
|
2022-03-12 17:06:03 -08:00
|
|
|
|
internal CheckResult(CheckIdentifier i) : this(Severity.Valid, LegalityCheckStrings.L_AValid, i) { }
|
2019-05-11 10:12:14 -07:00
|
|
|
|
|
2022-03-12 17:06:03 -08:00
|
|
|
|
public override string ToString() => $"{Identifier}: {Comment}";
|
|
|
|
|
public string Format(string format) => string.Format(format, Rating, Comment);
|
|
|
|
|
public string Format(string format, int index) => string.Format(format, Rating, index, Comment);
|
2017-05-27 21:17:53 -07:00
|
|
|
|
}
|