Skip to content

IngredientDraftExporter

Namespace Nfty.Core.Editing in assembly Nfty.Core.

public static class IngredientDraftExporter

Turns an IngredientDraft into the pair the existing IngredientArchive writes: a manifest plus one live image per variant id. Callers own the returned images.

Remarks

IngredientDraft.Kind alone decides which raster a variant exports — its VariantDraft.Color for Custom, its VariantDraft.Map for Dynamic and Static. A variant painted in color still holds both, so reading "whichever is non-null" would quietly export color art from a value-map layer and destroy the layer's color space.

Methods

Export(IngredientDraft)

public static (IngredientManifest, IReadOnlyDictionary<string, Image<Rgba32>>) Export(IngredientDraft draft);

Turns a draft into the manifest and images an .igt is written from.

Parameters

  • draft (IngredientDraft) - The draft to export.

Returns. The manifest and one image per variant; the caller owns the images.

Exceptions

  • InvalidOperationException - Two variants share an id, or a Custom variant has no color raster to write.