Class CustomerDataBuilder
Builder for composing CustomerData at runtime without asset bundles. Public surface uses strings/primitives only.
public sealed class CustomerDataBuilder
- Inheritance
-
CustomerDataBuilder
- Inherited Members
- Extension Methods
Methods
AllowDirectApproach(bool)
Controls whether the player can attempt to introduce themselves through a direct sample offer.
public CustomerDataBuilder AllowDirectApproach(bool allow)
Parameters
allowboolTrue to allow direct approach attempts; otherwise false.
Returns
- CustomerDataBuilder
The current builder for chaining.
GuaranteeFirstSample(bool)
Forces the first sample attempt to succeed, bypassing the normal mutual-relation chance check.
public CustomerDataBuilder GuaranteeFirstSample(bool guarantee)
Parameters
guaranteeboolTrue to guarantee first-sample success.
Returns
- CustomerDataBuilder
The current builder for chaining.
WithAffinities(IEnumerable<(DrugType drugType, float affinity)>)
Sets product type affinities using the enum. Replaces any existing default affinity data. Ensures all drug types are initialized (unspecified ones default to neutral affinity).
public CustomerDataBuilder WithAffinities(IEnumerable<(DrugType drugType, float affinity)> entries)
Parameters
entriesIEnumerable<(DrugType drugType, float affinity)>Drug-type values and affinity values to apply.
Returns
- CustomerDataBuilder
The current builder for chaining.
WithAffinities(IEnumerable<(string drugType, float affinity)>)
Sets product type affinities by drug-type name. e.g., ("Weed", 0.3f), ("Cocaine", -0.5f). Ensures all drug types are initialized (unspecified ones default to neutral affinity).
public CustomerDataBuilder WithAffinities(IEnumerable<(string drugType, float affinity)> entries)
Parameters
entriesIEnumerable<(string drugType, float affinity)>Drug-type names and affinity values to apply.
Returns
- CustomerDataBuilder
The current builder for chaining.
WithAffinity(DrugType, float)
Adds or overrides a single product type affinity entry.
public CustomerDataBuilder WithAffinity(DrugType drugType, float affinity)
Parameters
Returns
- CustomerDataBuilder
The current builder for chaining.
WithCallPoliceChance(float)
Sets the chance that the customer calls the police after rejecting a direct approach.
public CustomerDataBuilder WithCallPoliceChance(float chance)
Parameters
chancefloatChance from 0 to 1.
Returns
- CustomerDataBuilder
The current builder for chaining.
WithDependence(float, float)
Sets the customer's starting addiction level and how quickly dependence builds over time.
public CustomerDataBuilder WithDependence(float baseAddiction, float dependenceMultiplier = 1)
Parameters
baseAddictionfloatStarting addiction level in the 0..1 range.
dependenceMultiplierfloatDependence growth multiplier in the 0..2 range.
Returns
- CustomerDataBuilder
The current builder for chaining.
WithMutualRelationRequirement(float, float)
Sets the mutual-relationship thresholds used when a customer is approached directly for the first time.
The game checks the NPC's average relationship with mutual contacts and converts that value into a success chance.
Values at or below minAt50 behave as the low end of the chance curve, and values at or above
maxAt100 guarantee success. Values between them scale linearly.
public CustomerDataBuilder WithMutualRelationRequirement(float minAt50, float maxAt100)
Parameters
minAt50floatLower bound of the mutual-relationship success curve. Despite the historical name, this is better thought of as the point where the curve starts rather than a literal 50% threshold.
maxAt100floatMutual-relationship value that guarantees success.
Returns
- CustomerDataBuilder
The current builder for chaining.
WithOrderTime(int)
Sets the order time in 24h integer format (e.g., 930 for 9:30AM, 1745 for 5:45PM).
public CustomerDataBuilder WithOrderTime(int hhmm)
Parameters
hhmmint24-hour time in HHMM form.
Returns
- CustomerDataBuilder
The current builder for chaining.
WithOrdersPerWeek(int, int)
Sets how many orders this customer may place per week. Both values are clamped to the game's 0..7 range, and the maximum cannot be lower than the minimum.
public CustomerDataBuilder WithOrdersPerWeek(int min, int max)
Parameters
Returns
- CustomerDataBuilder
The current builder for chaining.
WithPreferredOrderDay(Day)
Sets the preferred order day using the API Day enum.
public CustomerDataBuilder WithPreferredOrderDay(Day day)
Parameters
dayDayPreferred order day.
Returns
- CustomerDataBuilder
The current builder for chaining.
WithPreferredOrderDay(string)
Sets the preferred order day using names like "Monday", "Tuesday", and so on. Invalid values are ignored.
public CustomerDataBuilder WithPreferredOrderDay(string day)
Parameters
daystringDay name to parse.
Returns
- CustomerDataBuilder
The current builder for chaining.
WithPreferredProperties(params PropertyBase[])
Assigns preferred properties from API property abstractions (tokens or wrappers). Does not expose game types to mod developers.
public CustomerDataBuilder WithPreferredProperties(params PropertyBase[] properties)
Parameters
propertiesPropertyBase[]Property abstractions to resolve and assign.
Returns
- CustomerDataBuilder
The current builder for chaining.
WithPreferredProperties(params ProductPropertyWrapper[])
Assigns preferred properties from wrappers.
public CustomerDataBuilder WithPreferredProperties(params ProductPropertyWrapper[] wrappers)
Parameters
wrappersProductPropertyWrapper[]Wrapped properties to assign.
Returns
- CustomerDataBuilder
The current builder for chaining.
WithPreferredPropertiesById(params string[])
Tries to assign preferred properties by ID using in-game Resources. IDs must match existing property assets.
public CustomerDataBuilder WithPreferredPropertiesById(params string[] propertyIds)
Parameters
propertyIdsstring[]Property IDs to resolve.
Returns
- CustomerDataBuilder
The current builder for chaining.
WithPreferredPropertiesByName(params string[])
Tries to assign preferred properties by asset name using in-game Resources. Names must match existing property assets.
public CustomerDataBuilder WithPreferredPropertiesByName(params string[] propertyNames)
Parameters
propertyNamesstring[]Property asset names to resolve.
Returns
- CustomerDataBuilder
The current builder for chaining.
WithSpending(float, float)
Sets the customer's weekly spending range. The minimum is clamped to 0, and the maximum is clamped so it cannot be lower than the minimum.
public CustomerDataBuilder WithSpending(float minWeekly, float maxWeekly)
Parameters
Returns
- CustomerDataBuilder
The current builder for chaining.
WithStandards(CustomerStandard)
Sets standards using the strongly-typed enum.
public CustomerDataBuilder WithStandards(CustomerStandard standards)
Parameters
standardsCustomerStandardCustomer standards value.
Returns
- CustomerDataBuilder
The current builder for chaining.
WithStandards(string)
Sets customer standards from a string such as "VeryLow", "Low", "Moderate", "High", or "VeryHigh". Invalid values are ignored.
public CustomerDataBuilder WithStandards(string standards)
Parameters
standardsstringStandards name to parse.
Returns
- CustomerDataBuilder
The current builder for chaining.