2017-06-07 03:10:05 +00:00
|
|
|
|
namespace PKHeX.Core
|
|
|
|
|
{
|
2017-10-24 06:12:58 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Source the Move was learned from
|
|
|
|
|
/// </summary>
|
2017-06-07 03:10:05 +00:00
|
|
|
|
public enum MoveSource
|
|
|
|
|
{
|
|
|
|
|
Unknown,
|
|
|
|
|
None,
|
|
|
|
|
Relearn,
|
|
|
|
|
Initial,
|
|
|
|
|
LevelUp,
|
|
|
|
|
TMHM,
|
|
|
|
|
Tutor,
|
|
|
|
|
EggMove,
|
|
|
|
|
InheritLevelUp,
|
|
|
|
|
Special,
|
|
|
|
|
SpecialEgg,
|
|
|
|
|
ShedinjaEvo,
|
|
|
|
|
Sketch,
|
2019-11-18 01:14:21 +00:00
|
|
|
|
Shared,
|
2017-06-07 03:10:05 +00:00
|
|
|
|
}
|
|
|
|
|
|
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
|
|
|
|
|
|
|
|
|
internal CheckMoveResult(MoveSource m, int g, CheckIdentifier i)
|
|
|
|
|
: base(i)
|
|
|
|
|
{
|
|
|
|
|
Source = m;
|
|
|
|
|
Generation = g;
|
|
|
|
|
}
|
2018-08-03 03:11:42 +00:00
|
|
|
|
|
2017-06-07 03:10:05 +00:00
|
|
|
|
internal CheckMoveResult(MoveSource m, int g, Severity s, string c, CheckIdentifier i)
|
|
|
|
|
: base(s, c, i)
|
|
|
|
|
{
|
|
|
|
|
Source = m;
|
|
|
|
|
Generation = g;
|
|
|
|
|
}
|
2018-08-03 03:11:42 +00:00
|
|
|
|
|
2017-06-07 03:10:05 +00:00
|
|
|
|
internal CheckMoveResult(CheckMoveResult Org, Severity s, string c, CheckIdentifier i)
|
2020-01-21 07:32:05 +00:00
|
|
|
|
: this(Org.Source, Org.Generation, s, c, i)
|
2017-06-07 03:10:05 +00:00
|
|
|
|
{
|
|
|
|
|
}
|
2020-08-30 22:43:29 +00:00
|
|
|
|
|
|
|
|
|
internal CheckMoveResult(CheckMoveResult Org, Severity s, string c)
|
|
|
|
|
: this(Org.Source, Org.Generation, s, c, Org.Identifier)
|
|
|
|
|
{
|
|
|
|
|
}
|
2017-06-07 03:10:05 +00:00
|
|
|
|
}
|
|
|
|
|
}
|