PKHeX/PKHeX.Core/Legality/RNG/Frame/LeadRequired.cs
Kurt fc754b346b
File scoped namespaces (#3529)
[Language Reference](https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/proposals/csharp-10.0/file-scoped-namespaces)

Updates all the files, one less level of indentation.

Some small changes were made to API surfaces, renaming `PKM pkm` -> `PKM pk`, and `LegalityAnalysis.pkm` -> `LegalityAnalysis.Entity`
2022-06-18 11:04:24 -07:00

52 lines
1.9 KiB
C#

using System;
namespace PKHeX.Core;
/// <summary>
/// Indicates the requirement of the player's lead Pokémon, first sent out when starting a battle.
/// </summary>
[Flags]
public enum LeadRequired
{
/// <summary> No Lead ability effect is present, or is not checked for this type of frame. </summary>
None = 0,
/// <summary> <see cref="Ability.CuteCharm"/> </summary>
CuteCharm = 1 << 0,
/// <summary> <see cref="Ability.Synchronize"/> </summary>
Synchronize = 1 << 1,
// Slot Modifiers
/// <summary> <see cref="Ability.Static"/> or <see cref="Ability.MagnetPull"/> </summary>
StaticMagnet = 1 << 2,
// Level Modifiers
/// <summary> <see cref="Ability.Intimidate"/> or <see cref="Ability.KeenEye"/> </summary>
IntimidateKeenEye = 1 << 3,
/// <summary> <see cref="Ability.Pressure"/> or <see cref="Ability.Hustle"/> or <see cref="Ability.VitalSpirit"/> </summary>
PressureHustleSpirit = 1 << 4,
/// <summary> <see cref="Ability.SuctionCups"/> </summary>
SuctionCups = 1 << 5,
// Compatibility Flags
UsesLevelCall = 1 << 6,
Fail = 1 << 7,
/// <summary> <inheritdoc cref="CuteCharm"/> </summary>
CuteCharmFail = CuteCharm | Fail,
/// <summary> <inheritdoc cref="Synchronize"/> </summary>
SynchronizeFail = Synchronize | Fail,
/// <summary> <inheritdoc cref="StaticMagnet"/> </summary>
StaticMagnetFail = StaticMagnet | Fail,
/// <summary> <inheritdoc cref="PressureHustleSpirit"/> </summary>
PressureHustleSpiritFail = PressureHustleSpirit | Fail,
AllFlags = UsesLevelCall | Fail,
}
public static partial class Extensions
{
internal static bool IsLevelOrSlotModified(this LeadRequired lead) => lead.RemoveFlags() > LeadRequired.Synchronize;
internal static LeadRequired RemoveFlags(this LeadRequired lead) => lead & ~LeadRequired.AllFlags;
internal static bool NeedsLevelCall(this LeadRequired lead) => (lead & LeadRequired.UsesLevelCall) != 0;
}