2022-03-13 01:06:03 +00:00
|
|
|
|
namespace PKHeX.Core;
|
2017-05-28 04:17:53 +00:00
|
|
|
|
|
2022-03-13 01:06:03 +00: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-03 03:11:42 +00:00
|
|
|
|
|
2022-03-13 01:06:03 +00:00
|
|
|
|
internal CheckResult(CheckIdentifier i) : this(Severity.Valid, LegalityCheckStrings.L_AValid, i) { }
|
2019-05-11 17:12:14 +00:00
|
|
|
|
|
2022-03-13 01:06:03 +00: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-28 04:17:53 +00:00
|
|
|
|
}
|