From cad09e68bbcef09bfcade6fc362c94a7a9c77987 Mon Sep 17 00:00:00 2001 From: Kurt Date: Thu, 12 Aug 2021 17:32:25 -0700 Subject: [PATCH] Fix source string returns I blame the goofy "move egg" names confusing me Reorder some so that the switch case is sequential and can be optimized by jit as a jumptable --- .../Legality/Moves/Breeding/EggSource.cs | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/PKHeX.Core/Legality/Moves/Breeding/EggSource.cs b/PKHeX.Core/Legality/Moves/Breeding/EggSource.cs index 74bffcbcf..fe5218361 100644 --- a/PKHeX.Core/Legality/Moves/Breeding/EggSource.cs +++ b/PKHeX.Core/Legality/Moves/Breeding/EggSource.cs @@ -115,9 +115,9 @@ static string GetLine(T[] arr, Func act, int index) public static string GetSource(this EggSource2 source) => source switch { EggSource2.Base => LMoveRelearnEgg, - EggSource2.FatherEgg => LMoveEggLevelUp, + EggSource2.FatherEgg => LMoveEggInherited, EggSource2.FatherTM => LMoveEggTMHM, - EggSource2.ParentLevelUp => LMoveEggInherited, + EggSource2.ParentLevelUp => LMoveEggLevelUp, EggSource2.Tutor => LMoveEggInheritedTutor, EggSource2.Max => "Any", _ => LMoveEggInvalid, @@ -126,32 +126,32 @@ static string GetLine(T[] arr, Func act, int index) public static string GetSource(this EggSource34 source) => source switch { EggSource34.Base => LMoveRelearnEgg, - EggSource34.FatherEgg => LMoveEggLevelUp, + EggSource34.FatherEgg => LMoveEggInherited, EggSource34.FatherTM => LMoveEggTMHM, - EggSource34.ParentLevelUp => LMoveEggInherited, - EggSource34.VoltTackle => LMoveSourceSpecial, + EggSource34.ParentLevelUp => LMoveEggLevelUp, EggSource34.Max => "Any", + EggSource34.VoltTackle => LMoveSourceSpecial, _ => LMoveEggInvalid, }; public static string GetSource(this EggSource5 source) => source switch { EggSource5.Base => LMoveRelearnEgg, - EggSource5.FatherEgg => LMoveEggLevelUp, + EggSource5.FatherEgg => LMoveEggInherited, + EggSource5.ParentLevelUp => LMoveEggLevelUp, EggSource5.FatherTM => LMoveEggTMHM, - EggSource5.ParentLevelUp => LMoveEggInherited, - EggSource5.VoltTackle => LMoveSourceSpecial, EggSource5.Max => "Any", + EggSource5.VoltTackle => LMoveSourceSpecial, _ => LMoveEggInvalid, }; public static string GetSource(this EggSource6 source) => source switch { EggSource6.Base => LMoveRelearnEgg, - EggSource6.ParentEgg => LMoveEggLevelUp, - EggSource6.ParentLevelUp => LMoveEggInherited, - EggSource6.VoltTackle => LMoveSourceSpecial, + EggSource6.ParentLevelUp => LMoveEggLevelUp, + EggSource6.ParentEgg => LMoveEggInherited, EggSource6.Max => "Any", + EggSource6.VoltTackle => LMoveSourceSpecial, _ => LMoveEggInvalid, }; }