Documented contract for an object that accepts ItemStack adds — the target type consumed by InventoryPickupBridge. InventoryTarget is a CONTRACT, not a base class: Inventory and ItemContainer satisfy it via duck-typing (they both expose add(stack: ItemStack) -> ItemStack and optionally a wallet property). The static helpers below validate that contract so misconfiguration fails LOUDLY at assignment time (in the bridge's target setter), not silently at pickup time. To support a new target type, expose:
func add(stack: ItemStack) -> ItemStack(required)var wallet: Wallet(optional; enables currency routing) Why a static guard and not a base class: Inventory and ItemContainer already have separate inheritance chains (both ultimately RefCounted). Forcing a common base would be an invasive class-hierarchy change for a one-method contract. The explicit guard achieves the same compile-time-near safety (assignment fails immediately with a clear message) without the hierarchy cost.
Source: addons/item_vault/bridge/inventory_target.gd
Syntax
class InventoryTarget extends RefCountedMembers
| Name | Kind | Summary |
|---|---|---|
is_valid_target | Method | |
get_wallet | Method | |
validate_or_warn | Method |