Move reset action to class

This commit is contained in:
Kurt 2020-10-04 12:08:16 -07:00
parent 09c6359e3a
commit 757456bf06
2 changed files with 14 additions and 6 deletions

View file

@ -250,12 +250,7 @@ namespace PKHeX.Core
if (pkm is IBattleVersion v && v.BattleVersion != 0)
{
reset = ((GameVersion) v.BattleVersion).GetGeneration();
source.EggEventSource = Array.Empty<int>();
source.Base = Array.Empty<int>();
source.EggLevelUpSource = Array.Empty<int>();
source.EggMoveSource = Array.Empty<int>();
source.NonTradeBackLevelUpMoves = Array.Empty<int>();
source.SpecialSource = Array.Empty<int>();
source.ResetSources();
}
// Check empty moves and relearn moves before generation specific moves

View file

@ -18,5 +18,18 @@ namespace PKHeX.Core
public int[] EggLevelUpSource { get; set; } = Empty;
public int[] EggMoveSource { get; set; } = Empty;
public IReadOnlyList<int> EggEventSource { get; set; } = Empty;
/// <summary>
/// Clears all sources except for the <see cref="CurrentMoves"/>.
/// </summary>
public void ResetSources()
{
EggEventSource = Empty;
Base = Empty;
EggLevelUpSource = Empty;
EggMoveSource = Empty;
NonTradeBackLevelUpMoves = Empty;
SpecialSource = Empty;
}
}
}