Table of Contents

Class ProductKindMetadataBuilder

Namespace
S1API.Products
Assembly
S1API.dll

Builds and registers immutable presentation metadata for a logical product kind.

public sealed class ProductKindMetadataBuilder
Inheritance
ProductKindMetadataBuilder
Inherited Members
Extension Methods

Constructors

ProductKindMetadataBuilder(ProductKind)

Creates a metadata builder for a registered logical product kind.

public ProductKindMetadataBuilder(ProductKind productKind)

Parameters

productKind ProductKind

The logical product kind to describe.

Exceptions

ArgumentNullException

Thrown when productKind is null.

Methods

Build()

Builds and registers the configured metadata.

public ProductKindMetadata Build()

Returns

ProductKindMetadata

The newly registered metadata, or the existing instance for an equivalent registration.

Exceptions

InvalidOperationException

Thrown when required metadata is missing, visible metadata lacks a compatibility drug type or icon, or conflicting metadata is already registered.

WithColor(Color)

Sets the presentation color.

public ProductKindMetadataBuilder WithColor(Color color)

Parameters

color Color

A color with finite component values.

Returns

ProductKindMetadataBuilder

This builder for method chaining.

Exceptions

ArgumentOutOfRangeException

Thrown when any color component is not finite.

WithDisplayName(string)

Sets the user-facing product-kind name.

public ProductKindMetadataBuilder WithDisplayName(string displayName)

Parameters

displayName string

The non-empty display name.

Returns

ProductKindMetadataBuilder

This builder for method chaining.

Exceptions

ArgumentNullException

Thrown when displayName is null.

ArgumentException

Thrown when displayName is empty or whitespace.

WithIcon(Sprite)

Sets the icon for a visible Product Manager section.

public ProductKindMetadataBuilder WithIcon(Sprite icon)

Parameters

icon Sprite

The section icon.

Returns

ProductKindMetadataBuilder

This builder for method chaining.

Exceptions

ArgumentNullException

Thrown when icon is null.

WithProductManagerVisibility(bool)

Sets whether custom products of this kind appear in the Product Manager.

public ProductKindMetadataBuilder WithProductManagerVisibility(bool visible = true)

Parameters

visible bool

true to create and maintain a Product Manager section; otherwise false.

Returns

ProductKindMetadataBuilder

This builder for method chaining.

WithSearchAliases(params string[])

Replaces the additional case-insensitive search aliases.

public ProductKindMetadataBuilder WithSearchAliases(params string[] searchAliases)

Parameters

searchAliases string[]

The aliases to use.

Returns

ProductKindMetadataBuilder

This builder for method chaining.

Remarks

Input order is preserved after case-insensitive deduplication. Because aliases are exposed as an ordered immutable snapshot, changing their order is a conflicting registration rather than an idempotent repeat.

Exceptions

ArgumentNullException

Thrown when the array or any alias is null.

ArgumentException

Thrown when an alias is empty or whitespace.

WithSortOrder(int)

Sets the relative order among custom Product Manager sections.

public ProductKindMetadataBuilder WithSortOrder(int sortOrder)

Parameters

sortOrder int

The custom-section order; lower values appear first.

Returns

ProductKindMetadataBuilder

This builder for method chaining.