Skip to content

PeekedCookBook

Namespace Nfty.Core.Formats in assembly Nfty.Core.

public record PeekedCookBook

A CookBook read as MANIFESTS ALONE: every weight, rule, absent-percent and variant name in the tree, and not one decoded pixel.

Remarks

This is ArchivePeek's argument carried one level deeper. That type exists because a workspace listing has no business decoding a book's art, and reads the outer manifest alone. But a whole class of question is answered by the nested manifests and by nothing else — how likely a selection was, what a rule forbids, which variants a layer carries — and answering one of those through CookBookArchive.Read() pulls every variant PNG in the collection into memory to look at a few dozen numbers.

So this is the shape those questions take their input in. It is deliberately NOT IDisposable: there is nothing here to own. LoadedCookBook remains the engine's form — Generator and Validator take that and only that, because they draw pixels — and a reader of this one must not assume the art is even present.

Recipe order here is ordinal, not the book's own CookBookManifest.RecipeOrder. That field is a listing preference and this is not a listing; anything that shows a reader a book's recipes wants CookBookArchive.Read() or the manifest field itself.

Constructors

PeekedCookBook(CookBookManifest, IReadOnlyList<PeekedRecipe>)

public PeekedCookBook(CookBookManifest Manifest, IReadOnlyList<PeekedRecipe> Recipes);

Parameters

  • Manifest (CookBookManifest) - The book's own manifest — canvas, collection, recipe weights.
  • Recipes (IReadOnlyList<PeekedRecipe>) - Its recipes, ordinally by id.

Remarks

This is ArchivePeek's argument carried one level deeper. That type exists because a workspace listing has no business decoding a book's art, and reads the outer manifest alone. But a whole class of question is answered by the nested manifests and by nothing else — how likely a selection was, what a rule forbids, which variants a layer carries — and answering one of those through CookBookArchive.Read() pulls every variant PNG in the collection into memory to look at a few dozen numbers.

So this is the shape those questions take their input in. It is deliberately NOT IDisposable: there is nothing here to own. LoadedCookBook remains the engine's form — Generator and Validator take that and only that, because they draw pixels — and a reader of this one must not assume the art is even present.

Recipe order here is ordinal, not the book's own CookBookManifest.RecipeOrder. That field is a listing preference and this is not a listing; anything that shows a reader a book's recipes wants CookBookArchive.Read() or the manifest field itself.

Properties

Manifest

public CookBookManifest Manifest { get; init; }

The book's own manifest — canvas, collection, recipe weights.

Recipes

public IReadOnlyList<PeekedRecipe> Recipes { get; init; }

Its recipes, ordinally by id.

Methods

Of(LoadedCookBook)

public static PeekedCookBook Of(LoadedCookBook book);

The same book, projected off one that is already open and decoded.

Parameters

  • book (LoadedCookBook) - A loaded book. Nothing is copied but the manifests, and the loaded book keeps ownership of every image in it.

Returns. Its manifest-only form.