PKHeX/PKHeX.Core/PKM/Strings/Trash/TrashMatch.cs
Kurt c10c2a0dc2
Add Trash Byte verification for Switch formats (#4283)
* Extract logic, finish impl for switch era
* Extract trash checks to static class
* Reduce some allocations in OT name compares
2024-05-27 18:21:11 -05:00

34 lines
693 B
C#

namespace PKHeX.Core;
public enum TrashMatch
{
/// <summary>
/// Expected under-layer of trash was not found.
/// </summary>
NotPresent,
NotEmpty,
/// <summary>
/// Displayed string is too long, with all bytes covering the initial trash.
/// </summary>
TooLongToTell,
/// <summary>
/// Expected under-layer of trash was found.
/// </summary>
Present,
PresentNone,
PresentSingle,
PresentMulti,
}
public static class TrashMatchExtensions
{
public static bool IsPresent(this TrashMatch match) => match >= TrashMatch.Present;
public static bool IsInvalid(this TrashMatch match) => match < TrashMatch.TooLongToTell;
}