Skip to main content

Module trade

Module trade 

Source
Expand description

Trade: TradeComponent (the trading post) and its merchants. See docs/TRADE.md.

Now and then (more often in bigger towns) a merchant’s boat comes up the river; while it is docked the merchant’s goods can be traded for the post’s. A merchant brings what was ordered from it, else lots of the goods it deals in.

Original: FUN_14005cd90, FUN_14005cfb0.

Structs§

Offer
A good the merchant brought (0x10 bytes): the good, its value and how many.
Order
A merchant’s order (TradeComponent, 0x20 bytes): the merchant’s name, the goods ordered and its state (0 none, 1 once, 2 every time).
Trade
TradeComponent: when it trades by itself (0 never, 1 when a merchant arrives, 2 when it leaves), the merchant docked (−1), the orders by merchant, the automatic trades by category (flags, index, amount), the merchant’s goods, the goods to keep at the post by raw material, TradeWork on, held (the trade window is open), the time to the next merchant or until it leaves, the boat.
TradeGood
A good with a ValueDescription: its template, its raw material (none for seeds and livestock) and value.
TradeTemplate
A resolved TradeDescription.
TradeWork
TradeWork: each hauler and what it carries to (more) or from (fewer) the post.

Enums§

TradeSetting
What the trade window changes on the post’s TradeComponent.

Functions§

merchant_list
The merchant’s own goods, then every good whose raw material has a flag it deals in, in the factory’s order.
sell_value
What the merchant docked gives for one: with none, its value; else its value for what it buys, three quarters for what it takes, else nothing.