mirror of
https://github.com/kwsch/PKHeX.git
synced 2026-09-10 02:27:54 -05:00
add optional sort param
This commit is contained in:
@@ -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<PKM>, IEnumerable<PKM>> 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;
|
||||
|
||||
Reference in New Issue
Block a user