Skip to content

Commit

Permalink
LoadOrder.FilterToMods
Browse files Browse the repository at this point in the history
  • Loading branch information
Noggog committed Dec 15, 2024
1 parent 8097da4 commit d7ec5af
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions Mutagen.Bethesda.Core/Extensions/LoadOrderExt.cs
Original file line number Diff line number Diff line change
Expand Up @@ -205,4 +205,18 @@ public static LoadOrder<TListing> Where<TListing>(this ILoadOrderGetter<TListing
loadOrder.ListedOrder
.Where(filter));
}

public static LoadOrder<TListing> FilterToMods<TListing>(this ILoadOrderGetter<TListing> loadOrder, IReadOnlyCollection<ModKey> modKeys)
where TListing : IModKeyed
{
return new LoadOrder<TListing>(
loadOrder.ListedOrder
.Where(x => modKeys.Contains(x.ModKey)));
}

public static LoadOrder<TListing> FilterToMods<TListing>(this ILoadOrderGetter<TListing> loadOrder, params ModKey[] modKeys)
where TListing : IModKeyed
{
return FilterToMods(loadOrder, modKeys.ToHashSet());
}
}

0 comments on commit d7ec5af

Please sign in to comment.