mirror of
https://github.com/kwsch/PKHeX
synced 2024-11-27 14:30:56 +00:00
907ed0b32f
tiny object, eliminate allocation for them since they're 10-16 bytes at most.
16 lines
644 B
C#
16 lines
644 B
C#
namespace PKHeX.Core;
|
|
|
|
/// <summary>
|
|
/// Result of a Legality Check
|
|
/// </summary>
|
|
[System.Diagnostics.DebuggerDisplay($"{{{nameof(Identifier)}}}: {{{nameof(Comment)}}}")]
|
|
// ReSharper disable once NotAccessedPositionalProperty.Global
|
|
public readonly record struct CheckResult(Severity Judgement, CheckIdentifier Identifier, string Comment)
|
|
{
|
|
public bool Valid => Judgement != Severity.Invalid;
|
|
public string Rating => Judgement.Description();
|
|
|
|
internal CheckResult(CheckIdentifier i) : this(Severity.Valid, i, LegalityCheckStrings.L_AValid) { }
|
|
|
|
public string Format(string format) => string.Format(format, Rating, Comment);
|
|
}
|