Skip to content

LoadedRecipe

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

public class LoadedRecipe : IDisposable

Owns its ingredients; disposing it disposes them and their images.

Constructors

LoadedRecipe()

public LoadedRecipe();

Properties

Ingredients

public required IReadOnlyList<LoadedIngredient> Ingredients { get; init; }

Its ingredients, each owning its own images.

Manifest

public required RecipeManifest Manifest { get; init; }

The recipe's manifest.

Methods

Dispose()

public void Dispose();

Frees every image this object owns. Reading an archive eagerly decodes them all, so this is how a caller gives them back.

Empty(string, string)

public static LoadedRecipe Empty(string id, string name);

A fresh recipe with no layers, no rules and no ingredients - what a wizard creates before the author fills it. Not yet generatable (its layer order is empty).

Parameters

  • id (string) - The recipe id.
  • name (string) - The recipe's display name.

Returns. The empty recipe.

Ingredient(string)

public LoadedIngredient Ingredient(string id);

One of this recipe's ingredients by id.

Parameters

  • id (string) - The ingredient id.

Returns. The ingredient.

Exceptions

  • KeyNotFoundException - No ingredient has that id; the message names it.

TryIngredient(string, LoadedIngredient?)

public bool TryIngredient(string id, out LoadedIngredient? ingredient);

One of this recipe's ingredients by id, if it has one.

Parameters

  • id (string) - The ingredient id.
  • ingredient (LoadedIngredient?) - The ingredient, or null.

Returns. Whether found.