SetModeler¶
Namespace Nfty.Model in assembly Nfty.Model.
Rises every asset of a cook into model files: StackDepth.ForAsset() for the depth, Riser.TryBuild() for the solid, ModelWriter for the bytes.
Remarks¶
Reads only — the book and the asset's picture are never mutated — so concurrent calls for different assets are safe and the bytes depend on the asset alone, at any thread count.
Constructors¶
SetModeler(LoadedCookBook, RiseOptions)¶
Creates the modeler.
Parameters
book(LoadedCookBook) - The book the Set is cooked from.options(RiseOptions) - How to rise and write.
Exceptions
PartialAlphaBookException- Some variant has a partly transparent pixel.
Properties¶
Options¶
The options the models are made with, recorded in set.json. Its SetModels.Skipped is ignored here; the writer fills it in.
Methods¶
FileNames(string)¶
Every file name IAssetModeler.Model() may return for an asset, derivable without building any model. The writer validates these for the whole Set before writing anything, then refuses a model file whose name was not declared here.
Parameters
baseName(string) - The asset's zero-padded number.
Returns. The bare file names.
Model(GeneratedAsset, string)¶
Files for one asset, named from baseName ("0007" becomes "0007.glb"), or null when nothing in it is fully opaque. Called concurrently for different assets, so it must be a pure function of its input.
Parameters
asset(GeneratedAsset) - The finished asset.baseName(string) - The asset's zero-padded number.
Returns. The files, or null when the asset cannot be modeled.