MenuBook¶
Namespace Nfty.Ticket in assembly Nfty.Ticket.
A CookBook flattened for runtime: every weight, rule and colorization, plus where the art is, and not one decoded pixel.
Remarks¶
MenuBook.MenuSchemaVersion is named — and therefore written and read — as menuSchemaVersion rather than the plain schemaVersion a member called SchemaVersion would camelCase to. A Menu's schema line is separate from Schema, the CookBook manifest line, and a shared key name between two independently evolving formats is how one gets bumped and silently changes what the other means. Named this way deliberately rather than overridden with a System.Text.Json.Serialization.JsonPropertyName attribute — no manifest record in this project carries a JSON attribute; the wire policy is supplied centrally (Nfty.Core.Formats.Json.Options on the write side, MenuArchive.WireOptions on the read side), and a property whose own name already produces the right key needs no exception to that rule.
Constructors¶
MenuBook(int, string?, Dimensions, string, string, IReadOnlyList<MenuRecipe>, MenuArt, bool)¶
public MenuBook(int MenuSchemaVersion, string? SourceCookBookSha256, Dimensions Canvas, string CollectionName, string CollectionSymbol, IReadOnlyList<MenuRecipe> Recipes, MenuArt Art, bool PartialAlpha = false);
Parameters
MenuSchemaVersion(int) - The Menu schema this was written against.SourceCookBookSha256(string?) - The hash of the.cbkthis came from, or null when it was built from a book that never came from a file. Null means "cannot tell", never "differs".Canvas(Dimensions) - The canvas every variant shares.CollectionName(string) - What assets are published as —"{name} #{n}".CollectionSymbol(string) - The collection's symbol.Recipes(IReadOnlyList<MenuRecipe>) - Its recipes.Art(MenuArt) - Where the art is.PartialAlpha(bool) - Whether any variant image anywhere in the book carries partial alpha — the same definitionNfty.Core.Imaging.Opacitystamps onto every archive manifest, projected here so a runtime host can tell 2D-only art (safe to lift with depth maps alone) from art with a transparency gradient Rise cannot resolve, with no.cbkpresent. Defaults tofalse— schema 1 Menus are refused outright, so this default now matters only for a hand-written schema 2 manifest that omits the field; every Menu this build actually writes carries a real, stamped value.
Remarks
MenuBook.MenuSchemaVersion is named — and therefore written and read — as menuSchemaVersion rather than the plain schemaVersion a member called SchemaVersion would camelCase to. A Menu's schema line is separate from Schema, the CookBook manifest line, and a shared key name between two independently evolving formats is how one gets bumped and silently changes what the other means. Named this way deliberately rather than overridden with a System.Text.Json.Serialization.JsonPropertyName attribute — no manifest record in this project carries a JSON attribute; the wire policy is supplied centrally (Nfty.Core.Formats.Json.Options on the write side, MenuArchive.WireOptions on the read side), and a property whose own name already produces the right key needs no exception to that rule.
Properties¶
Art¶
Where the art is.
Canvas¶
The canvas every variant shares.
CollectionName¶
What assets are published as — "{name} #{n}".
CollectionSymbol¶
The collection's symbol.
MenuSchemaVersion¶
The Menu schema this was written against.
PartialAlpha¶
Whether any variant image anywhere in the book carries partial alpha — the same definition Nfty.Core.Imaging.Opacity stamps onto every archive manifest, projected here so a runtime host can tell 2D-only art (safe to lift with depth maps alone) from art with a transparency gradient Rise cannot resolve, with no .cbk present. Defaults to false — schema 1 Menus are refused outright, so this default now matters only for a hand-written schema 2 manifest that omits the field; every Menu this build actually writes carries a real, stamped value.
Recipes¶
Its recipes.
SourceCookBookSha256¶
The hash of the .cbk this came from, or null when it was built from a book that never came from a file. Null means "cannot tell", never "differs".
Methods¶
CellKey(string, string, string)¶
The key one variant's art is stored under.
Parameters
recipeId(string) - The recipe the layer belongs to.ingredientId(string) - The layer.variantId(string) - The variant.
Returns. The cell key.
Remarks
Scoped by RECIPE, and that is not redundancy. A .cbk nests a separate .igt inside each .rcp, so two recipes may each carry an ingredient with the id bg holding completely different variants. A shallower key collides without a word and one recipe silently draws another's art.