From 1eff57bd8723231c4e88c168c436be143c8f28d4 Mon Sep 17 00:00:00 2001 From: Kaphotics Date: Thu, 7 Apr 2016 17:42:53 -0700 Subject: [PATCH] Simplify move suggestion method Relying on linq... so rich. Take the suggested moves, select a string array, and join. --- PKX/f1-Main.cs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/PKX/f1-Main.cs b/PKX/f1-Main.cs index 0f2052f21..11ccb44fa 100644 --- a/PKX/f1-Main.cs +++ b/PKX/f1-Main.cs @@ -1456,11 +1456,7 @@ namespace PKHeX { updateLegality(); int[] m = Legality.getSuggestedRelearn(); - string[] s = new string[4]; - for (int i = 0; i < 4; i++) - s[i] = movelist[m[i]]; - - string r = string.Join(Environment.NewLine, s); + string r = string.Join(Environment.NewLine, m.Select(v => v >= movelist.Length ? "ERROR" : movelist[v])); if (DialogResult.Yes != Util.Prompt(MessageBoxButtons.YesNo, "Apply suggested relearn moves?", r)) return;