Table of Contents

Class ProductDefinition

Namespace
S1API.Products
Assembly
S1API.dll

Represents a product definition in the game.

public class ProductDefinition : ItemDefinition
Inheritance
ProductDefinition
Derived
Inherited Members
Extension Methods

Properties

BasePrice

The base price associated with this product.

public float BasePrice { get; }

Property Value

float

DrugType

The primary drug type for this product (convenience property).

public EDrugType DrugType { get; }

Property Value

EDrugType

DrugTypes

The list of drug types associated with this product definition. Returns a C# list for IL2CPP builds to avoid type mismatches.

public List<DrugTypeContainer> DrugTypes { get; }

Property Value

List<DrugTypeContainer>

Icon

Gets the in-game icon associated with the product.

public Sprite Icon { get; }

Property Value

Sprite

MarketValue

The market value associated with this product.

public float MarketValue { get; }

Property Value

float

Price

The price associated with this product.

public float Price { get; }

Property Value

float

Properties

The list of product properties for this definition. Returns runtime-agnostic property wrappers that work on both Mono and IL2CPP.

public IReadOnlyList<PropertyBase> Properties { get; }

Property Value

IReadOnlyList<PropertyBase>

Methods

CreateInstance(int)

Creates an instance of this product in-game.

public override ItemInstance CreateInstance(int quantity = 1)

Parameters

quantity int

The quantity of product.

Returns

ItemInstance

An instance of the product.

CreatePackagedInstance(int, PackagingDefinition)

Creates a packaged instance of this product with the specified packaging.

public ProductInstance? CreatePackagedInstance(int quantity, PackagingDefinition packaging)

Parameters

quantity int

The quantity of the product.

packaging PackagingDefinition

The packaging to apply to the product.

Returns

ProductInstance

A packaged product instance, or null if packaging is not found.