Skip to content

RulesEngine

Namespace Nfty.Core.Generation in assembly Nfty.Ticket.

public static class RulesEngine

Decides whether a rolled selection satisfies a recipe's incompatibility rules.

Methods

IsLegal(IReadOnlyDictionary<string, string>, IReadOnlyList<IncompatibilityRule>)

public static bool IsLegal(IReadOnlyDictionary<string, string> selection, IReadOnlyList<IncompatibilityRule> rules);

Checks a selection against the rules.

Parameters

  • selection (IReadOnlyDictionary<string, string>) - Variant id per ingredient id.
  • rules (IReadOnlyList<IncompatibilityRule>) - The recipe's rules.

Returns. True when no rule is violated.