Skip to content

MenuRecipe

Namespace Nfty.Ticket in assembly Nfty.Ticket.

public record MenuRecipe

One recipe, as a Menu records it.

Constructors

MenuRecipe(string, string, double, IReadOnlyList<string>, IReadOnlyList<MenuLayer>, IReadOnlyList<IncompatibilityRule>, IReadOnlyDictionary<string, double>)

public MenuRecipe(string Id, string Name, double Weight, IReadOnlyList<string> LayerOrder, IReadOnlyList<MenuLayer> Layers, IReadOnlyList<IncompatibilityRule> Rules, IReadOnlyDictionary<string, double> AbsentPercent);

Parameters

  • Id (string) - The recipe id.
  • Name (string) - Its display name, published as the Type trait.
  • Weight (double) - Its weight against the book's other recipes.
  • LayerOrder (IReadOnlyList<string>) - Bottom-to-top paint order — and the order the roll consumes the RNG in, which is why it travels rather than being inferred from Layers.
  • Layers (IReadOnlyList<MenuLayer>) - Its layers, keyed by the ids in LayerOrder.
  • Rules (IReadOnlyList<IncompatibilityRule>) - Its incompatibility rules.
  • AbsentPercent (IReadOnlyDictionary<string, double>) - How often each layer is left out, keyed by ingredient id. A layer absent from this map always appears.

Properties

AbsentPercent

public IReadOnlyDictionary<string, double> AbsentPercent { get; init; }

How often each layer is left out, keyed by ingredient id. A layer absent from this map always appears.

Id

public string Id { get; init; }

The recipe id.

LayerOrder

public IReadOnlyList<string> LayerOrder { get; init; }

Bottom-to-top paint order — and the order the roll consumes the RNG in, which is why it travels rather than being inferred from Layers.

Layers

public IReadOnlyList<MenuLayer> Layers { get; init; }

Its layers, keyed by the ids in LayerOrder.

Name

public string Name { get; init; }

Its display name, published as the Type trait.

Rules

public IReadOnlyList<IncompatibilityRule> Rules { get; init; }

Its incompatibility rules.

Weight

public double Weight { get; init; }

Its weight against the book's other recipes.

Methods

AbsentPercentOf(string)

public double AbsentPercentOf(string ingredientId);

How often ingredientId is left out of this recipe, 0..100.

Parameters

  • ingredientId (string) - The layer to ask about.

Returns. The recorded percent, or zero when the recipe records none.