namespace PKHeX.Core;
///
/// Contains information about the RNG restrictions for the slot, and any mutated RNG values.
///
///
/// When encountering a Wild Pokémon with a lead that has an ability of or ,
/// the game picks encounters from the that match the type.
/// The values in this interface change the to allow different values for slot yielding.
///
public interface IMagnetStatic
{
/// if the lead is
byte StaticIndex { get; }
/// if the lead is
byte MagnetPullIndex { get; }
/// Count of slots in the parent area that can be yielded by
byte StaticCount { get; }
/// Count of slots in the parent area that can be yielded by
byte MagnetPullCount { get; }
}
public static class MagnetStaticExtensions
{
private const byte NotMagnetStaticSlot = byte.MaxValue;
public static bool IsStaticSlot(this IMagnetStatic slot) => slot.StaticCount != 0 && slot.StaticIndex != NotMagnetStaticSlot;
public static bool IsMagnetSlot(this IMagnetStatic slot) => slot.MagnetPullCount != 0 && slot.MagnetPullIndex != NotMagnetStaticSlot;
public static bool IsMatchStatic(this IMagnetStatic slot, int index, int count) => index == slot.StaticIndex && count == slot.StaticCount;
public static bool IsMatchMagnet(this IMagnetStatic slot, int index, int count) => index == slot.MagnetPullIndex && count == slot.MagnetPullCount;
}