Table of Contents

Class ProductConsumptionContext

Namespace
S1API.Products
Assembly
S1API.dll

Describes one intrinsic consumption lifecycle transition for a registered custom product.

public sealed class ProductConsumptionContext
Inheritance
ProductConsumptionContext
Inherited Members
Extension Methods

Remarks

Player callbacks are invoked only for the local player. NPC callbacks can receive an unavailable NPC wrapper for game-owned NPCs; use TargetId when behavior only needs the stable native target identifier.

Properties

Definition

Gets the registered custom product definition.

public CustomProductDefinition Definition { get; }

Property Value

CustomProductDefinition

IsLocalPlayer

Gets whether this transition targets the local player.

public bool IsLocalPlayer { get; }

Property Value

bool

NPC

Gets the S1API NPC wrapper when one is available, or null for a game-owned NPC without an S1API wrapper.

public NPC? NPC { get; }

Property Value

NPC

Player

Gets the local player for player callbacks, or null for NPC callbacks.

public Player? Player { get; }

Property Value

Player

Product

Gets the consumed product instance.

public ProductInstance Product { get; }

Property Value

ProductInstance

ProductId

Gets the stable product identifier.

public string ProductId { get; }

Property Value

string

ProductKind

Gets the logical product kind retained by generated mixed products.

public ProductKind ProductKind { get; }

Property Value

ProductKind

Properties

Gets the ordinary product properties applied alongside this profile.

public IReadOnlyList<PropertyBase> Properties { get; }

Property Value

IReadOnlyList<PropertyBase>

Quality

Gets the consumed product quality.

public Quality Quality { get; }

Property Value

Quality

TargetId

Gets the stable native target identifier: a player code for players or the NPC ID for NPCs.

public string TargetId { get; }

Property Value

string