Skip to content

GeneratedSet

Namespace Nfty.Core.Generation in assembly Nfty.Core.

public record GeneratedSet : IDisposable

A whole generated collection, held in memory. Disposing it disposes every asset image, so using var set = Generator.Generate(...) is the safe default. A caller that cannot afford the whole set at once should use Generator.GenerateStreaming() instead and dispose each asset as it lands.

Constructors

GeneratedSet(string, string, string, string, IReadOnlyList<GeneratedAsset>, string?, bool)

public GeneratedSet(string CollectionName, string Description, string Symbol, string Seed, IReadOnlyList<GeneratedAsset> Assets, string? CookbookSha256 = null, bool UniqueDna = true);

Parameters

  • CollectionName (string) - The collection's published name.
  • Description (string) - The collection's description.
  • Symbol (string) - The collection's ticker-style symbol.
  • Seed (string) - The seed that produced the run.
  • Assets (IReadOnlyList<GeneratedAsset>) - The finished assets, in set-number order. Owned by this set.
  • CookbookSha256 (string?) - Hash of the source .cbk; null for a book never read from a file.
  • UniqueDna (bool) - Whether the run enforced distinct DNA.

Properties

Assets

public IReadOnlyList<GeneratedAsset> Assets { get; init; }

The finished assets, in set-number order. Owned by this set.

CollectionName

public string CollectionName { get; init; }

The collection's published name.

CookbookSha256

public string? CookbookSha256 { get; init; }

Hash of the source .cbk; null for a book never read from a file.

Description

public string Description { get; init; }

The collection's description.

Seed

public string Seed { get; init; }

The seed that produced the run.

Symbol

public string Symbol { get; init; }

The collection's ticker-style symbol.

UniqueDna

public bool UniqueDna { get; init; }

Whether the run enforced distinct DNA.

Methods

Dispose()

public void Dispose();

Frees every asset image in the set.