LoadedCookBook¶
Namespace Nfty.Core.Formats in assembly Nfty.Core.
Owns its recipes, which own their ingredients, which own the variant images — so using var book = CookBookArchive.Read(path) frees the whole tree. Reading an archive pulls every variant PNG into memory, so a caller that opens books repeatedly (a GUI) must dispose each one.
Constructors¶
LoadedCookBook()¶
Properties¶
Manifest¶
The book's manifest.
Recipes¶
Its recipes, each owning its own ingredients.
SourceSha256¶
SHA-256 of the .cbk this was read from, recorded into a generated Set so an output can be traced back to the exact archive that produced it. Null for a book that never came from a file (built in memory, or still unsaved in an editor).
Methods¶
Dispose()¶
Frees every image this object owns. Reading an archive eagerly decodes them all, so this is how a caller gives them back.
Recipe(string)¶
One of this book's recipes by id.
Parameters
id(string) - The recipe id.
Returns. The recipe.
Exceptions
KeyNotFoundException- No recipe has that id; the message names it.
TryRecipe(string, LoadedRecipe?)¶
One of this book's recipes by id, if it has one.
Parameters
id(string) - The recipe id.recipe(LoadedRecipe?) - The recipe, or null.
Returns. Whether found.