Table of Contents

Class SupplierDataBuilder

Namespace
S1API.Entities.Supplier
Assembly
S1API.dll

Builds the native framework data used by a custom supplier NPC.

public sealed class SupplierDataBuilder
Inheritance
SupplierDataBuilder
Inherited Members
Extension Methods

Methods

WithDeliveryItem(ItemDefinition)

Adds an item to this supplier's dead-drop and meeting-shop listings.

public SupplierDataBuilder WithDeliveryItem(ItemDefinition item)

Parameters

item ItemDefinition

A public wrapper around a native storable item definition.

Returns

SupplierDataBuilder

The current builder for chaining.

Exceptions

ArgumentNullException

Thrown when item is null.

ArgumentException

Thrown when the wrapped item is not storable.

WithDeliveryItem(StorableItemDefinition)

Adds a storable item to this supplier's dead-drop and meeting-shop listings.

public SupplierDataBuilder WithDeliveryItem(StorableItemDefinition item)

Parameters

item StorableItemDefinition

The storable item wrapper to add.

Returns

SupplierDataBuilder

The current builder for chaining.

WithDeliveryItem(string)

Declares an item ID for this supplier.

public SupplierDataBuilder WithDeliveryItem(string itemId)

Parameters

itemId string

The stable item ID. The item may be registered after NPC prefab discovery; S1API resolves it when supplier runtime data is materialized.

Returns

SupplierDataBuilder

The current builder for chaining.

Exceptions

ArgumentException

Thrown when the ID is empty.

WithDeliveryItems(IEnumerable<ItemDefinition>)

Adds multiple item wrappers to this supplier's listings.

public SupplierDataBuilder WithDeliveryItems(IEnumerable<ItemDefinition> items)

Parameters

items IEnumerable<ItemDefinition>

The item wrappers to add.

Returns

SupplierDataBuilder

The current builder for chaining.

Exceptions

ArgumentNullException

Thrown when items is null.

WithOrderLimits(float, float)

Sets the minimum and maximum dead-drop order values.

public SupplierDataBuilder WithOrderLimits(float minimum, float maximum)

Parameters

minimum float

Order limit at the lowest relationship level.

maximum float

Order limit at the highest relationship level.

Returns

SupplierDataBuilder

The current builder for chaining.

Exceptions

ArgumentOutOfRangeException

Thrown when either value is not finite, the minimum is negative, the maximum is not positive, or the maximum is below the minimum.

WithPersistentId(string)

Keeps this supplier's generated shop, delivery vehicle, and generated stash identities on an existing persistent ID.

public SupplierDataBuilder WithPersistentId(string persistentId)

Parameters

persistentId string

The non-empty ID used by the previous supplier release.

Returns

SupplierDataBuilder

The current builder for chaining.

Remarks

This does not change the NPC's runtime ID. Use it only when a released supplier must adopt a new runtime NPC ID while preserving the supplier data derived from its former ID.

Exceptions

ArgumentException

Thrown when the ID is empty or whitespace.

WithRecommendationMessage(string?)

Sets the message used when another NPC recommends this supplier.

public SupplierDataBuilder WithRecommendationMessage(string? message)

Parameters

message string

Recommendation text. Native placeholders such as <NAME> and <PRODUCT> are supported. Null clears the text.

Returns

SupplierDataBuilder

The current builder for chaining.

WithStashDeadDrop(DeadDropInstance)

Uses an existing scene dead drop as this supplier's debt-payment stash.

public SupplierDataBuilder WithStashDeadDrop(DeadDropInstance deadDrop)

Parameters

deadDrop DeadDropInstance

The dead drop to use as the supplier stash.

Returns

SupplierDataBuilder

The current builder for chaining.

Remarks

The selected dead drop is reserved from normal supplier delivery selection. Omitting this option preserves the generated stash beside the supplier spawn.

WithStashDeadDrop(string)

Uses the scene dead drop with the specified GUID as this supplier's debt-payment stash.

public SupplierDataBuilder WithStashDeadDrop(string deadDropGuid)

Parameters

deadDropGuid string

The stable GUID exposed by GUID.

Returns

SupplierDataBuilder

The current builder for chaining.

WithStashDeadDrop<T>()

Uses the native dead drop represented by T as this supplier's debt-payment stash.

public SupplierDataBuilder WithStashDeadDrop<T>() where T : IDeadDropIdentifier

Returns

SupplierDataBuilder

Type Parameters

T

WithUnlockHint(string?)

Sets the hint shown when this supplier and product are unlocked.

public SupplierDataBuilder WithUnlockHint(string? hint)

Parameters

hint string

Unlock hint text. Native placeholders are supported. Null clears the text.

Returns

SupplierDataBuilder

The current builder for chaining.