Trading

Trading subsystem for the Shop system. Manages trade exchanges between agents and players through a TradingArea surface and a TradeContext data container.

Architecture

spinner

Data Flow

spinner

Key Concepts

Concept
Description

TradingArea

TableArea subclass that holds a single pending TradeContext

TradeContext

Immutable data binding an Agent, Item, and Coin value for a trade

Single pending trade

Only one trade can be awaiting at a time per TradingArea

Player completes

The Player triggers completion, receiving the item's coin value

Classes

Class
Description

Trade surface managing pending trade lifecycle

Immutable data container for a pending trade

See Also

  • DisplayArea — sibling area type for item display

  • Agent — the entity that initiates trades

Last updated