From 488b5215a7f375cb2fc3d718bab0b1d1632f63ac Mon Sep 17 00:00:00 2001 From: Kurt Date: Sat, 21 Apr 2018 15:07:58 -0700 Subject: [PATCH] add optional sort param --- PKHeX.Core/Saves/SaveFile.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PKHeX.Core/Saves/SaveFile.cs b/PKHeX.Core/Saves/SaveFile.cs index e09fbaf6e..13618284d 100644 --- a/PKHeX.Core/Saves/SaveFile.cs +++ b/PKHeX.Core/Saves/SaveFile.cs @@ -588,7 +588,7 @@ public bool IsAnySlotLockedInBox(int BoxStart, int BoxEnd) } public virtual bool IsSlotInBattleTeam(int box, int slot) => false; - public void SortBoxes(int BoxStart = 0, int BoxEnd = -1) + public void SortBoxes(int BoxStart = 0, int BoxEnd = -1, Func, IEnumerable> sortMethod = null) { var BD = BoxData; int start = BoxSlotCount * BoxStart; @@ -596,7 +596,7 @@ public void SortBoxes(int BoxStart = 0, int BoxEnd = -1) if (BoxEnd > BoxStart) Section = Section.Take(BoxSlotCount * (BoxEnd - BoxStart)); - var Sorted = Section.OrderBySpecies(); + var Sorted = (sortMethod ?? PKMSorting.OrderBySpecies)(Section); Sorted.CopyTo(BD, start); BoxData = BD;