PKHeX/PKHeX.Core/Legality/Verifiers/ConsoleRegionVerifier.cs
Kurt c8563a3737 Respacening
Style guidelines, handle a bunch of files
no functional change
2018-07-26 19:34:27 -07:00

30 lines
900 B
C#

using static PKHeX.Core.LegalityCheckStrings;
namespace PKHeX.Core
{
/// <summary>
/// Verifies the <see cref="PKM.ConsoleRegion"/> and <see cref="PKM.Country"/> of origin values.
/// </summary>
public sealed class ConsoleRegionVerifier : Verifier
{
protected override CheckIdentifier Identifier => CheckIdentifier.Geography;
public override void Verify(LegalityAnalysis data)
{
var result = VerifyConsoleRegion(data.pkm);
data.AddLine(result);
}
private CheckResult VerifyConsoleRegion(PKM pkm)
{
int consoleRegion = pkm.ConsoleRegion;
if (consoleRegion >= 7)
return GetInvalid(V301);
if (!Legal.IsConsoleRegionCountryValid(consoleRegion, pkm.Country))
return GetInvalid(V302);
return GetValid(V303);
}
}
}