Skip to content

RecipeSpace

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

public record RecipeSpace

One recipe's share of the space.

Constructors

RecipeSpace(BigInteger, BigInteger, SpaceCertainty)

public RecipeSpace(BigInteger Total, BigInteger Combos, SpaceCertainty Certainty);

Parameters

  • Total (BigInteger) - Legal combinations times reachable color buckets. This is the recipe's space in isolation and is recorded even for a shelved (zero-weight) recipe; whether the cookbook can actually roll it is a separate question the cookbook-level UniqueSpaceCount.Total answers.
  • Combos (BigInteger) - The legal variant combinations alone, without color buckets folded in. RecipeSpace.Total can be zero for two unrelated reasons — the rules exclude every combination, or a layer has no reachable color buckets — and only this figure tells them apart. A caller must never read a zero RecipeSpace.Total as a rule conflict.
  • Certainty (SpaceCertainty) - What RecipeSpace.Total is: the figure, a floor, a ceiling, or nothing. Decided while counting, where it is still known WHICH half gave up — a under-counted bucket set multiplied by zero combinations lands back at zero, so this cannot be re-derived afterwards from the total alone.

Properties

Certainty

public SpaceCertainty Certainty { get; init; }

What RecipeSpace.Total is: the figure, a floor, a ceiling, or nothing. Decided while counting, where it is still known WHICH half gave up — a under-counted bucket set multiplied by zero combinations lands back at zero, so this cannot be re-derived afterwards from the total alone.

Combos

public BigInteger Combos { get; init; }

The legal variant combinations alone, without color buckets folded in. RecipeSpace.Total can be zero for two unrelated reasons — the rules exclude every combination, or a layer has no reachable color buckets — and only this figure tells them apart. A caller must never read a zero RecipeSpace.Total as a rule conflict.

IsCountable

public bool IsCountable { get; }

Whether this figure means anything to show a user. UniqueSpaceCount.IsExact alone is false for two unrelated situations: a bucket set was under-counted ("more than UniqueSpaceCount.Total", a real lower bound), and the space is undefined because the book is invalid in a way that makes the question meaningless. The second reports Total == 0, and rendering that as "more than 0" states a bound that is technically true and reads like an answer.

Every front-end needs this distinction — the CLI's stats, the GUI's identity card and its per-recipe rows — so it is decided once here instead of three times, differently.

IsExact

public bool IsExact { get; }

Whether RecipeSpace.Total is the real figure rather than a bound.

Total

public BigInteger Total { get; init; }

Legal combinations times reachable color buckets. This is the recipe's space in isolation and is recorded even for a shelved (zero-weight) recipe; whether the cookbook can actually roll it is a separate question the cookbook-level UniqueSpaceCount.Total answers.