Table of Contents

Class ProductMixingProfileBuilder

Namespace
S1API.Products
Assembly
S1API.dll

Builds and registers an opt-in mixing profile for one logical product kind.

public sealed class ProductMixingProfileBuilder
Inheritance
ProductMixingProfileBuilder
Inherited Members
Extension Methods

Constructors

ProductMixingProfileBuilder(ProductKind)

Creates a mixing-profile builder for a registered logical product kind.

public ProductMixingProfileBuilder(ProductKind productKind)

Parameters

productKind ProductKind

The stable logical kind that opts into mixing.

Exceptions

ArgumentNullException

Thrown when productKind is null.

Methods

Build()

Builds and registers this immutable mixing profile.

public ProductMixingProfile Build()

Returns

ProductMixingProfile

The registered profile, or the existing equivalent profile.

Exceptions

InvalidOperationException

Thrown when no output factory was configured.

WithMixerMap(ProductMixingMap)

Sets the native mixer-map execution strategy.

public ProductMixingProfileBuilder WithMixerMap(ProductMixingMap mixerMap)

Parameters

mixerMap ProductMixingMap

Returns

ProductMixingProfileBuilder

Remarks

This does not alter the logical product kind or require it to have a matching vanilla drug type. The selected map is only the explicit native seam used while mixing.

WithOutputFactory(Func<ProductMixingOutput, ProductMixingOutputDefinition>)

Sets the deterministic factory that names, prices, and optionally transforms generated outputs.

public ProductMixingProfileBuilder WithOutputFactory(Func<ProductMixingOutput, ProductMixingOutputDefinition> outputFactory)

Parameters

outputFactory Func<ProductMixingOutput, ProductMixingOutputDefinition>

A deterministic factory invoked for each native mixing output.

Returns

ProductMixingProfileBuilder

This builder.

Exceptions

ArgumentNullException

Thrown when outputFactory is null.

WithOutputFactoryCompatibility(string, int)

Sets the stable compatibility identity for the configured output factory.

public ProductMixingProfileBuilder WithOutputFactoryCompatibility(string identity, int version)

Parameters

identity string
version int

Returns

ProductMixingProfileBuilder

Remarks

Register the same identity and version on every peer. This identity is included in the multiplayer manifest so different output behavior is rejected before a mix can diverge.

WithPropertyColorMixing()

Colors each generated output from its mixed properties using the selected native mixer map's primary-color strategy.

public ProductMixingProfileBuilder WithPropertyColorMixing()

Returns

ProductMixingProfileBuilder

Remarks

This is opt-in. It affects only generated mixes and does not recolor the base custom product. The resulting color is persisted with the generated product so save reloads and peers render the same appearance.