Skip to content

VariantReach

Namespace Nfty.Core.Stats in assembly Nfty.Core.

public sealed record VariantReach

How far one variant's edit reaches: the share of the collection that carries it, and, when the book states a target supply, the expected number of assets.

Remarks

The figure is RarityCalculator's OverallPercent, the number the Ingredient pane already prints, so the two cannot disagree. An expected count is never exact, hence the ~.

Constructors

VariantReach(double, int?, bool)

public VariantReach(double Percent, int? TargetSupply, bool RecipeHasRules);

Parameters

  • Percent (double) - The book-wide share (recipe share and absence folded in), 0..100.
  • TargetSupply (int?) - The book's intended supply, or null.
  • RecipeHasRules (bool) - Whether the variant's recipe has incompatibility rules, which can shift the real share away from the weights.

Remarks

The figure is RarityCalculator's OverallPercent, the number the Ingredient pane already prints, so the two cannot disagree. An expected count is never exact, hence the ~.

Properties

Percent

public double Percent { get; init; }

The book-wide share (recipe share and absence folded in), 0..100.

RecipeHasRules

public bool RecipeHasRules { get; init; }

Whether the variant's recipe has incompatibility rules, which can shift the real share away from the weights.

TargetSupply

public int? TargetSupply { get; init; }

The book's intended supply, or null.

Text

public string Text { get; }

The reach as a sentence fragment, invariant: in ~900 of 1,200 assets, in all 1,200 assets, in 75% of assets or in every asset.

Tip

public string Tip { get; }

What the figure is, for a tooltip.

Methods

Of(LoadedCookBook, string, string, string)

public static VariantReach Of(LoadedCookBook book, string recipeId, string ingredientId, string variantId);

Computes the reach of one variant in one recipe. An unknown id gives 0%, never a throw.

Parameters

  • book (LoadedCookBook) - The book.
  • recipeId (string) - The recipe.
  • ingredientId (string) - The layer.
  • variantId (string) - The variant.

Returns. The reach.