PKHeX/PKHeX.Core/Legality/Structures/CheckResult.cs
Kurt d02b87a7b2 Expose checkresult properties
can now check individual strings / identifiers in a LegalityAnalysis
object by:

var la = new LegalityAnalysis(pkm);
var parse = la.Info.Parse;
if (parse.Any(z => ReferenceEquals(z.Comment, LegalityCheckStrings.X))
...
should be faster than doing string.Contains
2018-09-05 21:27:52 -07:00

29 lines
765 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;
}
}
}