namespace PKHeX.Core { /// /// Move specific to contain in which Generation it was learned & source. /// public sealed class CheckMoveResult : CheckResult { /// /// Method of learning the move. /// public readonly MoveSource Source; /// /// Generation the move was learned in. /// public readonly int Generation; /// /// Indicates if the source of the move was validated from the /// public bool IsRelearn => Source == MoveSource.Relearn || (Source == MoveSource.EggMove && Generation >= 6); /// /// Indicates if the source of the move was validated as originating from an egg. /// public bool IsEggSource => Source is MoveSource.EggMove or MoveSource.InheritLevelUp; /// /// Checks if the Move should be present in a Relearn move pool (assuming Gen6+ origins). /// /// Invalid moves that can't be validated should be here, hence the inclusion. public bool ShouldBeInRelearnMoves() => Source != MoveSource.None && (!Valid || IsRelearn); internal CheckMoveResult(MoveSource m, int g, CheckIdentifier i) : base(i) { Source = m; Generation = g; } internal CheckMoveResult(MoveSource m, int g, Severity s, string c, CheckIdentifier i) : base(s, c, i) { Source = m; Generation = g; } internal CheckMoveResult(CheckMoveResult original, Severity s, string c, CheckIdentifier i) : this(original.Source, original.Generation, s, c, i) { } internal CheckMoveResult(CheckMoveResult original, Severity s, string c) : this(original.Source, original.Generation, s, c, original.Identifier) { } } }