mirror of
https://github.com/kwsch/PKHeX
synced 2024-12-19 00:43:14 +00:00
d02b87a7b2
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
29 lines
765 B
C#
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;
|
|
}
|
|
}
|
|
}
|