mirror of
https://github.com/kwsch/PKHeX
synced 2024-11-15 16:48:01 +00:00
91c37ab573
V### names weren't enjoyable to work with; use similar verbose style as the program message strings. updating the translation files with the remapped variable names shortly remap list: https://pastebin.com/jybkVDAK
30 lines
941 B
C#
30 lines
941 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(LGeoHardwareRange);
|
|
|
|
if (!Legal.IsConsoleRegionCountryValid(consoleRegion, pkm.Country))
|
|
return GetInvalid(LGeoHardwareInvalid);
|
|
|
|
return GetValid(LGeoHardwareValid);
|
|
}
|
|
}
|
|
}
|