Class SupplierDataBuilder
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
itemItemDefinitionA public wrapper around a native storable item definition.
Returns
- SupplierDataBuilder
The current builder for chaining.
Exceptions
- ArgumentNullException
Thrown when
itemis 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
itemStorableItemDefinitionThe 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
itemIdstringThe 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
itemsIEnumerable<ItemDefinition>The item wrappers to add.
Returns
- SupplierDataBuilder
The current builder for chaining.
Exceptions
- ArgumentNullException
Thrown when
itemsis null.
WithOrderLimits(float, float)
Sets the minimum and maximum dead-drop order values.
public SupplierDataBuilder WithOrderLimits(float minimum, float maximum)
Parameters
minimumfloatOrder limit at the lowest relationship level.
maximumfloatOrder 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
persistentIdstringThe 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
messagestringRecommendation 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
deadDropDeadDropInstanceThe 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
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
Type Parameters
T
WithUnlockHint(string?)
Sets the hint shown when this supplier and product are unlocked.
public SupplierDataBuilder WithUnlockHint(string? hint)
Parameters
hintstringUnlock hint text. Native placeholders are supported. Null clears the text.
Returns
- SupplierDataBuilder
The current builder for chaining.