Trading subsystem for the Shop system. Manages trade exchanges between agents and players through a TradingArea surface and a TradeContext data container.
Architecture
Data Flow
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