Skip to content

Commit

Permalink
Env builder WithLoadOrder that takes LoadOrder
Browse files Browse the repository at this point in the history
  • Loading branch information
Noggog committed Jan 2, 2025
1 parent 8143330 commit 1a867dd
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions Mutagen.Bethesda.Core/Environments/GameEnvironmentBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,16 @@ public GameEnvironmentBuilder<TMod, TModGetter> WithLoadOrder(params ILoadOrderL
return TransformLoadOrderListings(_ => listings);
}

/// <summary>
/// Sets the load order to the given listings
/// </summary>
/// <param name="loadOrder">Load Order to get listings from</param>
/// <returns>New builder with the new rules</returns>
public GameEnvironmentBuilder<TMod, TModGetter> WithLoadOrder(ILoadOrderGetter loadOrder)
{
return TransformLoadOrderListings(_ => loadOrder.ListedOrder.Select(x => (ILoadOrderListingGetter)new LoadOrderListing(x, enabled: true)).ToArray());
}

/// <summary>
/// Exposes the load order for transformation by the user with mod objects loaded and accessible
/// </summary>
Expand Down

0 comments on commit 1a867dd

Please sign in to comment.