2021-06-30 03:58:06 +00:00
|
|
|
|
using static PKHeX.Core.LegalityCheckStrings;
|
|
|
|
|
|
2022-06-18 18:04:24 +00:00
|
|
|
|
namespace PKHeX.Core;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Verifies the <see cref="PK4.GroundTile"/>.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public sealed class GroundTileVerifier : Verifier
|
2021-06-30 03:58:06 +00:00
|
|
|
|
{
|
2022-06-18 18:04:24 +00:00
|
|
|
|
protected override CheckIdentifier Identifier => CheckIdentifier.Encounter;
|
2021-06-30 03:58:06 +00:00
|
|
|
|
|
2022-06-18 18:04:24 +00:00
|
|
|
|
public override void Verify(LegalityAnalysis data)
|
|
|
|
|
{
|
|
|
|
|
if (data.Entity is not IGroundTile e)
|
|
|
|
|
return;
|
|
|
|
|
var type = data.EncounterMatch is IGroundTypeTile t ? t.GroundTile : GroundTileAllowed.None;
|
|
|
|
|
var result = !type.Contains(e.GroundTile) ? GetInvalid(LEncTypeMismatch) : GetValid(LEncTypeMatch);
|
|
|
|
|
data.AddLine(result);
|
2021-06-30 03:58:06 +00:00
|
|
|
|
}
|
|
|
|
|
}
|