mirror of
https://github.com/kwsch/PKHeX
synced 2024-11-15 08:47:14 +00:00
21e7f4317e
increase readability, simplifly some expressions relocate hot path for legality report string creation
32 lines
958 B
C#
32 lines
958 B
C#
namespace PKHeX.Core
|
|
{
|
|
/// <summary>
|
|
/// Result of a Legality Check
|
|
/// </summary>
|
|
public class CheckResult
|
|
{
|
|
public Severity Judgement { get; }
|
|
public CheckIdentifier Identifier { get; }
|
|
public string Comment { get; internal set; }
|
|
|
|
public bool Valid => Judgement >= Severity.Fishy;
|
|
public string Rating => Judgement.Description();
|
|
|
|
internal CheckResult(CheckIdentifier i)
|
|
{
|
|
Judgement = Severity.Valid;
|
|
Comment = LegalityCheckStrings.L_AValid;
|
|
Identifier = i;
|
|
}
|
|
|
|
internal CheckResult(Severity s, string c, CheckIdentifier i)
|
|
{
|
|
Judgement = s;
|
|
Comment = c;
|
|
Identifier = i;
|
|
}
|
|
|
|
public string Format(string format) => string.Format(format, Rating, Comment);
|
|
public string Format(string format, int index) => string.Format(format, Rating, index, Comment);
|
|
}
|
|
}
|