mirror of
https://github.com/kwsch/PKHeX.git
synced 2026-05-09 12:35:20 -05:00
Extract OrderByTrainer
logic to order-group may be useful for later
This commit is contained in:
parent
f6dda90f52
commit
ea227a8113
|
|
@ -109,10 +109,7 @@ public static IEnumerable<PKM> OrderByOwnership(this IEnumerable<PKM> list, ITra
|
|||
{
|
||||
return list.InitialSortBy()
|
||||
.ThenByDescending(trainer.IsOriginalHandler) // true first
|
||||
.ThenBy(p => p.OT_Name)
|
||||
.ThenBy(p => p.OT_Gender)
|
||||
.ThenBy(p => p.TID)
|
||||
.ThenBy(p => p.SID)
|
||||
.OrderByTrainer()
|
||||
.ThenBy(p => p.Species)
|
||||
.FinalSortBy();
|
||||
}
|
||||
|
|
@ -154,6 +151,18 @@ private static IOrderedEnumerable<PKM> FinalSortBy(this IOrderedEnumerable<PKM>
|
|||
return postSorted;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Common mid-filtering grouping of PKM data according to the Original Trainer details.
|
||||
/// </summary>
|
||||
/// <param name="list">Output list of <see cref="PKM"/> data.</param>
|
||||
private static IOrderedEnumerable<PKM> OrderByTrainer(this IOrderedEnumerable<PKM> list)
|
||||
{
|
||||
return list.ThenBy(p => p.OT_Name)
|
||||
.ThenBy(p => p.OT_Gender)
|
||||
.ThenBy(p => p.TID)
|
||||
.ThenBy(p => p.SID);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets if the current handler is the original trainer.
|
||||
/// </summary>
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user