mirror of
https://github.com/kwsch/PKHeX
synced 2024-11-27 14:30:56 +00:00
22 lines
718 B
C#
22 lines
718 B
C#
|
using static PKHeX.Core.LegalityCheckStrings;
|
|||
|
|
|||
|
namespace PKHeX.Core
|
|||
|
{
|
|||
|
/// <summary>
|
|||
|
/// Verifies the <see cref="PK4.GroundTile"/>.
|
|||
|
/// </summary>
|
|||
|
public sealed class GroundTileVerifier : Verifier
|
|||
|
{
|
|||
|
protected override CheckIdentifier Identifier => CheckIdentifier.Encounter;
|
|||
|
|
|||
|
public override void Verify(LegalityAnalysis data)
|
|||
|
{
|
|||
|
if (data.pkm is not IGroundTile e)
|
|||
|
return;
|
|||
|
var type = data.EncounterMatch is IGroundTypeTile t ? t.GroundTile : GroundTilePermission.None;
|
|||
|
var result = !type.Contains(e.GroundTile) ? GetInvalid(LEncTypeMismatch) : GetValid(LEncTypeMatch);
|
|||
|
data.AddLine(result);
|
|||
|
}
|
|||
|
}
|
|||
|
}
|