Skip to content

ModelTokens

Namespace Nfty.Model in assembly Nfty.Model.

public static class ModelTokens

The text spellings of ModelFormat and Pivot, in one place. The CLI's --format / --pivot and set.json's models block both use these tokens, so the two can never disagree about what a recorded Set was made with.

Properties

FormatNames

public static IReadOnlyList<string> FormatNames { get; }

Every format token, in the order the CLI lists them.

PivotNames

public static IReadOnlyList<string> PivotNames { get; }

Every pivot token, in the order the CLI lists them.

Methods

FormatOf(string)

public static ModelFormat FormatOf(string token);

The format a token names.

Parameters

Returns. The format.

Exceptions

  • ArgumentException - The token is unknown; nothing is guessed.

NameOf(ModelFormat)

public static string NameOf(ModelFormat format);

The token for a format.

Parameters

  • format (ModelFormat) - The format.

Returns. Its token.

Exceptions

  • ArgumentOutOfRangeException - Not a named format.

NameOf(Pivot)

public static string NameOf(Pivot pivot);

The token for a pivot.

Parameters

  • pivot (Pivot) - The pivot.

Returns. Its token.

Exceptions

  • ArgumentOutOfRangeException - Not a named pivot.

OptionsOf(SetModels)

public static RiseOptions OptionsOf(SetModels models);

The options a recorded block describes.

Parameters

  • models (SetModels) - The block read from set.json.

Returns. The options.

Exceptions

  • ArgumentException - A token is unknown.

PivotOf(string)

public static Pivot PivotOf(string token);

The pivot a token names.

Parameters

Returns. The pivot.

Exceptions

  • ArgumentException - The token is unknown; nothing is guessed.

Record(RiseOptions)

public static SetModels Record(RiseOptions options);

The set.json block describing a cook made with these options.

Parameters

  • options (RiseOptions) - The options.

Returns. Tokens plus voxel size, with nothing skipped yet.