2017-06-07 03:10:05 +00:00
|
|
|
|
namespace PKHeX.Core
|
|
|
|
|
{
|
2017-10-24 06:12:58 +00:00
|
|
|
|
/// <summary>
|
2018-10-31 20:52:09 +00:00
|
|
|
|
/// Move specific <see cref="CheckResult"/> to contain in which Generation it was learned & source.
|
2017-10-24 06:12:58 +00:00
|
|
|
|
/// </summary>
|
2019-10-04 02:09:02 +00:00
|
|
|
|
public sealed class CheckMoveResult : CheckResult
|
2017-06-07 03:10:05 +00:00
|
|
|
|
{
|
2020-10-17 20:40:12 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Method of learning the move.
|
|
|
|
|
/// </summary>
|
2017-06-07 03:10:05 +00:00
|
|
|
|
public readonly MoveSource Source;
|
2020-10-17 20:40:12 +00:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Generation the move was learned in.
|
|
|
|
|
/// </summary>
|
2017-06-07 03:10:05 +00:00
|
|
|
|
public readonly int Generation;
|
2020-10-17 20:40:12 +00:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Indicates if the source of the move was validated from the <see cref="PKM.RelearnMoves"/>
|
|
|
|
|
/// </summary>
|
2021-01-29 02:08:13 +00:00
|
|
|
|
public bool IsRelearn => Source == MoveSource.Relearn || (Source == MoveSource.EggMove && Generation >= 6);
|
2020-10-17 20:40:12 +00:00
|
|
|
|
|
2021-05-16 04:41:04 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Indicates if the source of the move was validated as originating from an egg.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public bool IsEggSource => Source is MoveSource.EggMove or MoveSource.InheritLevelUp;
|
|
|
|
|
|
2020-10-17 20:40:12 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Checks if the Move should be present in a Relearn move pool (assuming Gen6+ origins).
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <remarks>Invalid moves that can't be validated should be here, hence the inclusion.</remarks>
|
|
|
|
|
public bool ShouldBeInRelearnMoves() => Source != MoveSource.None && (!Valid || IsRelearn);
|
2017-06-07 03:10:05 +00:00
|
|
|
|
|
2021-10-09 23:25:36 +00:00
|
|
|
|
internal CheckMoveResult(MoveSource m, int g, CheckIdentifier i) : base(i)
|
2017-06-07 03:10:05 +00:00
|
|
|
|
{
|
|
|
|
|
Source = m;
|
|
|
|
|
Generation = g;
|
|
|
|
|
}
|
2018-08-03 03:11:42 +00:00
|
|
|
|
|
2021-10-09 23:25:36 +00:00
|
|
|
|
internal CheckMoveResult(MoveSource m, int g, Severity s, string c, CheckIdentifier i) : base(s, c, i)
|
2017-06-07 03:10:05 +00:00
|
|
|
|
{
|
|
|
|
|
Source = m;
|
|
|
|
|
Generation = g;
|
|
|
|
|
}
|
2018-08-03 03:11:42 +00:00
|
|
|
|
|
2021-10-09 23:25:36 +00:00
|
|
|
|
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) { }
|
2017-06-07 03:10:05 +00:00
|
|
|
|
}
|
|
|
|
|
}
|