namespace PKHeX.Core;
using static LearnMethod;
///
/// Indicates the method of learning a move
///
public enum LearnMethod : byte
{
// Invalid
#region Invalid
/// Unable to detect a valid method of learning the move.
None,
/// Move is a duplicate of another move in the set.
Duplicate,
/// Move is empty but should be present.
/// Usually uses to indicate what it was expecting instead.
EmptyInvalid,
/// Move is unobtainable.
Unobtainable,
/// Expected a specific move instead of the one present.
UnobtainableExpect,
#endregion
// Valid
/// Nothing present in the slot.
Empty,
/// Initial Move from the species' level-up table.
Initial,
/// Learned via level-up.
LevelUp,
/// Learned via instructional machine (TM, HM, TR).
TMHM,
/// Learned via Move Tutor.
Tutor,
/// Learned by the move .
Sketch,
/// Learned from another game's side-data via HOME.
HOME,
/// Added special for the Encounter.
Encounter,
/// Learned upon Evolution
/// Special case for Generation 2 where no move reminder exists.
Evolution,
/// Shared from another species at a Daycare/Picnic.
Shared,
/// Evolution split happened immediately after leveling up and learning the move.
/// Only possible for Gen3 and Gen4.
ShedinjaEvo,
#region Relearn
/// Remembered from its special Relearn Move set.
Relearn,
#endregion
#region Egg
/// Inherited from the species' Egg table (not level-up).
EggMove,
/// Inherited from the species' level-up table.
InheritLevelUp,
/// Inserted under certain conditions
///
SpecialEgg,
#endregion
}
///
/// Extension methods for .
///
public static class LearnMethodExtensions
{
///
/// Checks if the is a valid method of learning a move.
///
/// Method to check
/// True if the method is valid, false otherwise.
public static bool IsValid(this LearnMethod method) => method >= Empty;
///
/// Checks if the is expecting another move instead.
///
/// Method to check
/// True if the method is valid, false otherwise.
public static bool HasExpectedMove(this LearnMethod method) => method is UnobtainableExpect;
///
/// Checks if the is valid because of it being a Relearn move.
///
/// Method to check
/// True if the method is valid, false otherwise.
public static bool IsRelearn(this LearnMethod method) => method is Relearn;
///
/// Checks if the is valid because of it being an egg move.
///
/// Method to check
/// True if the method is valid, false otherwise.
public static bool IsEggSource(this LearnMethod method) => method is EggMove or InheritLevelUp or SpecialEgg;
}