Table of Contents

Class ProductKindBuilder

Namespace
S1API.Products
Assembly
S1API.dll

Builds and registers immutable logical product kinds.

public sealed class ProductKindBuilder
Inheritance
ProductKindBuilder
Inherited Members
Extension Methods

Constructors

ProductKindBuilder(string)

Creates a builder for a stable, namespaced logical product kind.

public ProductKindBuilder(string id)

Parameters

id string

A stable identifier in <namespace>:<name> form, such as examplemod:mdma.

Exceptions

ArgumentNullException

Thrown when id is null.

ArgumentException

Thrown when id is empty or does not use the supported namespaced format.

Methods

Build()

Builds and registers the configured product kind.

public ProductKind Build()

Returns

ProductKind

The newly registered product kind, or the existing instance when an equivalent registration already exists.

Remarks

Repeated calls return the existing instance while the builder configuration remains equivalent. Changing compatibility metadata after the first successful call creates a conflicting registration.

Exceptions

InvalidOperationException

Thrown when the identifier is already registered with different compatibility metadata.

WithCompatibilityDrugType(DrugType)

Sets optional compatibility metadata for systems that still reason about vanilla drug types.

public ProductKindBuilder WithCompatibilityDrugType(DrugType drugType)

Parameters

drugType DrugType

The API-safe vanilla drug type that best represents this product kind.

Returns

ProductKindBuilder

This builder for method chaining.

Exceptions

ArgumentOutOfRangeException

Thrown when drugType is not a defined DrugType value.