From eaeebea9238863e04ec470b022f24f2f50a010d6 Mon Sep 17 00:00:00 2001 From: Kurt Date: Sun, 12 Jan 2020 17:00:03 -0800 Subject: [PATCH] Remove another method shortcut EncounterSuggestion needs a facelift anyway --- PKHeX.Core/Editing/Bulk/PKMInfo.cs | 2 +- PKHeX.Core/Editing/CommonEdits.cs | 2 +- PKHeX.Core/Legality/Analysis.cs | 5 ----- .../Legality/Encounters/Information/EncounterSuggestion.cs | 3 +++ PKHeX.WinForms/Controls/PKM Editor/PKMEditor.cs | 2 +- 5 files changed, 6 insertions(+), 8 deletions(-) diff --git a/PKHeX.Core/Editing/Bulk/PKMInfo.cs b/PKHeX.Core/Editing/Bulk/PKMInfo.cs index 986512e71..1eff8b811 100644 --- a/PKHeX.Core/Editing/Bulk/PKMInfo.cs +++ b/PKHeX.Core/Editing/Bulk/PKMInfo.cs @@ -15,6 +15,6 @@ internal sealed class PKMInfo public bool Legal => Legality.Valid; internal IReadOnlyList SuggestedRelearn => Legality.GetSuggestedRelearn(); - internal EncounterStatic? SuggestedEncounter => Legality.GetSuggestedMetInfo(); + internal EncounterStatic? SuggestedEncounter => EncounterSuggestion.GetSuggestedMetInfo(Entity); } } \ No newline at end of file diff --git a/PKHeX.Core/Editing/CommonEdits.cs b/PKHeX.Core/Editing/CommonEdits.cs index 1fc16e46f..4b74e203a 100644 --- a/PKHeX.Core/Editing/CommonEdits.cs +++ b/PKHeX.Core/Editing/CommonEdits.cs @@ -313,7 +313,7 @@ public static IReadOnlyList GetSuggestedRelearnMoves(this LegalityAnalysis if (enc is MysteryGift || enc is EncounterEgg) return m; - var encounter = legal.GetSuggestedMetInfo(); + var encounter = EncounterSuggestion.GetSuggestedMetInfo(legal.pkm); if (encounter is IRelearn r && r.Relearn.Length > 0) m = r.Relearn; diff --git a/PKHeX.Core/Legality/Analysis.cs b/PKHeX.Core/Legality/Analysis.cs index 1be9c5ef5..4f237d9c4 100644 --- a/PKHeX.Core/Legality/Analysis.cs +++ b/PKHeX.Core/Legality/Analysis.cs @@ -470,10 +470,5 @@ public int[] GetSuggestedMoves(bool tm, bool tutor, bool reminder) var evos = Info.EvoChainsAllGens; return Legal.GetValidMoves(pkm, evos, Tutor: tutor, Machine: tm, MoveReminder: reminder).Skip(1).ToArray(); // skip move 0 } - - /// - /// Gets an object containing met data properties that might be legal. - /// - public EncounterStatic? GetSuggestedMetInfo() => EncounterSuggestion.GetSuggestedMetInfo(pkm); } } diff --git a/PKHeX.Core/Legality/Encounters/Information/EncounterSuggestion.cs b/PKHeX.Core/Legality/Encounters/Information/EncounterSuggestion.cs index 8974c253c..da1f73b71 100644 --- a/PKHeX.Core/Legality/Encounters/Information/EncounterSuggestion.cs +++ b/PKHeX.Core/Legality/Encounters/Information/EncounterSuggestion.cs @@ -7,6 +7,9 @@ namespace PKHeX.Core /// public static class EncounterSuggestion { + /// + /// Gets an object containing met data properties that might be legal. + /// public static EncounterStatic? GetSuggestedMetInfo(PKM pkm) { int loc = GetSuggestedTransferLocation(pkm); diff --git a/PKHeX.WinForms/Controls/PKM Editor/PKMEditor.cs b/PKHeX.WinForms/Controls/PKM Editor/PKMEditor.cs index 85b07960d..27a364a3a 100644 --- a/PKHeX.WinForms/Controls/PKM Editor/PKMEditor.cs +++ b/PKHeX.WinForms/Controls/PKM Editor/PKMEditor.cs @@ -733,7 +733,7 @@ private bool SetSuggestedRelearnMoves(bool silent = false) private bool SetSuggestedMetLocation(bool silent = false) { - var encounter = Legality.GetSuggestedMetInfo(); + var encounter = EncounterSuggestion.GetSuggestedMetInfo(Entity); if (encounter == null || (Entity.Format >= 3 && encounter.Location < 0)) { if (!silent)