mirror of
https://github.com/kwsch/PKHeX
synced 2024-12-23 02:43:13 +00:00
103aa9aa4b
EncounterArea now stores a more specific type'd array for encounter slots. Better iteration and less casting, as the nonspecific `Slots` fetch is rarely referenced. EncounterType renamed to GroundTile to reflect how it actually works in Gen4. Was previously an ambiguous field that was clarified a little; we can describe it a little better now. Keep the GUI the same to not scare the end users. Change Trash Byte properties to get/set a Span. Trash Byte legality checking easier on the garbage collector?
21 lines
718 B
C#
21 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);
|
|
}
|
|
}
|
|
}
|