Skip to content

CollectionReport

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

public static class CollectionReport

The stats report as data plus a plain-text rendering: the odds a CookBook's weights imply, and the size of the unique-DNA space they admit. The CLI printed this straight to the console, so the GUI could only have re-derived it. Both now call this, which also means the text a user copies out of the GUI is byte-identical to what the command prints — the same report, not a similar one.

Methods

Render(LoadedCookBook)

public static string Render(LoadedCookBook book);

Renders the report. Every number is formatted with InvariantCulture: this is a report a user copies, pastes into an issue and compares against someone else's, so a decimal comma on one machine and a point on another would make two identical collections look different.

Parameters

  • book (LoadedCookBook) - The cookbook to describe.

Returns. The report text, invariant-culture formatted.

UniqueDnaLine(LoadedCookBook)

public static string UniqueDnaLine(LoadedCookBook book);

The largest number of unique-DNA assets this CookBook can produce — the figure generate reports only on failure, surfaced so a run can be sized before it starts.

Four outcomes, not two, and SpaceText is where they are worded — the same formatter the GUI's card uses, so the two surfaces cannot drift. This file used to carry its own copy of the decision and the CookBook card carried another, worded differently.

The uncountable case adds a hint the card has no room for, and keeps SpaceText.Unknown as its opening words rather than restating them. UniqueSpace.Count() is documented never to throw; the catch below is belt-and-braces, not the mechanism. It used to be the mechanism, which meant the no-throw contract was asserted in one file and quietly worked around in this one.

Parameters

  • book (LoadedCookBook) - The CookBook to size.

Returns. A single line, always — this never throws and never omits the line.