SetFiles¶
Namespace Nfty.Core.Output in assembly Nfty.Core.
ONE mapping between a set number and the name its files carry: images/, metadata/ and models/. The writer's own names (0001.png) are the default; an export may rename them to token ids and shift the first id, and records that in set.json so every reader finds the same files the exporter wrote.
Remarks¶
Every reader of a per-asset file asks here - SetReader, the models lookup, the viewer, the exporter itself - because a second copy of "number to file name" is how a renamed export stops opening. nfty/ is the exception by design: it keeps the Set's own names, as nfty's cross-referenced record, and carries the set number inside.
Constructors¶
SetFiles(string, int)¶
Parameters
Naming(string) - The spelling token:padded(0001) ortoken-id(1).Start(int) - The token id of the first asset: 1, or 0.
Remarks
Every reader of a per-asset file asks here - SetReader, the models lookup, the viewer, the exporter itself - because a second copy of "number to file name" is how a renamed export stops opening. nfty/ is the exception by design: it keeps the Set's own names, as nfty's cross-referenced record, and carries the set number inside.
Fields¶
PaddedWord¶
The token for the writer's own zero-padded names.
TokenIdWord¶
The token for bare token-id names.
Properties¶
Default¶
The writer's own names, starting at 1: what a Set with no record follows.
IsDefault¶
Whether this is exactly the writer's own naming.
IsKnown¶
Whether this build knows the spelling; an unknown one is refused rather than guessed.
IsPadded¶
Whether names are zero-padded.
Naming¶
The spelling token: padded (0001) or token-id (1).
Start¶
The token id of the first asset: 1, or 0.
Methods¶
Id(int)¶
The token id of the asset with this set number.
Parameters
number(int) - The set number, from 1.
Returns. The id.
ImageFile(int)¶
The asset's picture, relative to images/.
Parameters
number(int) - The set number.
Returns. The file name.
MetadataFile(int)¶
The asset's metadata file, relative to metadata/: the bare token id when token-id named, so a contract's baseURI + tokenId resolves it.
Parameters
number(int) - The set number.
Returns. The file name.
NumberOf(string)¶
The set number a per-asset file's name carries, or null for a name the writer would not have given.
Parameters
file(string) - A file name or path; the extension is ignored.
Returns. The set number, from 1, or null.
Stem(int)¶
The name an asset's files share, without extension.
Parameters
number(int) - The set number.
Returns. For example 0001 or 0.