Skip to content

Commit

Permalink
Added RelationshipResolver.DefaultOpts().
Browse files Browse the repository at this point in the history
  • Loading branch information
pjf committed Oct 18, 2014
1 parent 0d53412 commit def2a91
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions RelationshipResolver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ public struct RelationshipResolverOptions {
public bool with_all_suggests;
}

// Alas, it appears that structs cannot have defaults. Try
// DefaultOpts() to get friendly defaults.

public class RelationshipResolver {

// A list of all the mods we're going to install.
Expand Down Expand Up @@ -49,6 +52,19 @@ public RelationshipResolver (List<string> modules, RelationshipResolverOptions o

}

/// <summary>
/// Returns the default options for relationship resolution.
/// </summary>
public static RelationshipResolverOptions DefaultOpts()
{
var opts = new RelationshipResolverOptions ();
opts.with_recommends = true;
opts.with_suggests = false;
opts.with_all_suggests = false;

return opts;
}

// Resolve all relationships for a module.
// May recurse to ResolveStanza.
private void Resolve(CkanModule module, RelationshipResolverOptions options) {
Expand Down

0 comments on commit def2a91

Please sign in to comment.