Skip to content

LoadedSet

Namespace Nfty.Core.Output in assembly Nfty.Core.

public class LoadedSet : IDisposable

A cooked Set read from disk for browsing: the manifest + per-item metadata and image paths (images are NOT decoded here). If read from a .set archive, owns the extracted temp dir.

Remarks

Not sealed, so Publish.SealedSet can BE one while also carrying the seal it came out of. A sealed Set is a loaded Set with provenance, and every screen that shows one has to show what it is permitted to do with it — a policy handed back beside the data, for the caller to remember to carry, is a policy that eventually arrives nowhere. There is no protected state and LoadedSet.Dispose() frees only what this type owns, so subclassing costs nothing.

Constructors

LoadedSet()

public LoadedSet();

Properties

Items

public required IReadOnlyList<SetItem> Items { get; init; }

Its assets, as metadata plus image paths.

Manifest

public required SetManifest Manifest { get; init; }

The Set's manifest.

SourceDirectory

public string SourceDirectory { get; init; }

The folder this Set's files are actually in — the folder it was opened from, or the temporary directory a .set was unpacked into.

Remarks

So a caller that already has the Set open does not have to unpack it a second time to do something with its files. The export dialog recomputes what it is about to ship on every checkbox, and re-extracting a ten-thousand-asset archive per keystroke is not a thing that can be made fast afterwards.

Empty for a LoadedSet that was never read from disk — which is only ever a test fixture, since every reader here sets it. Not required for that reason: making it so would force every hand-built fixture to name a directory it does not have and would not use.

Methods

Dispose()

public void Dispose();

Releases anything the reader holds. A Set is read as paths, so this frees the temporary extraction directory when the Set came from a packed .set or a seal.