pub struct Trade {
pub mode: i32,
pub merchant: i32,
pub orders: Vec<Order>,
pub automatic: Vec<(u32, i32, i32)>,
pub offers: Vec<Offer>,
pub keep: BTreeMap<usize, i32>,
pub working: bool,
pub held: bool,
pub timer: i64,
pub boat: Option<usize>,
}Expand description
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.
Fields§
§mode: i32When it trades by itself: 0 never, 1 when a merchant arrives, 2 when it leaves.
merchant: i32The merchant docked (−1 none).
orders: Vec<Order>The orders, by merchant.
automatic: Vec<(u32, i32, i32)>The automatic trades by category: (flags, index, amount).
offers: Vec<Offer>The merchant’s goods.
keep: BTreeMap<usize, i32>The goods to keep at the post, by raw material.
working: boolWhether the post’s hauling work is on.
held: boolWhether the trade window is open.
timer: i64The time to the next merchant, or until it leaves.
boat: Option<usize>The boat, if any.
Implementations§
Source§impl Trade
impl Trade
Sourcepub fn new(
t: &TradeTemplate,
rng: &mut Random,
names: Option<&(NameDatabase, NameDatabase)>,
) -> Trade
pub fn new( t: &TradeTemplate, rng: &mut Random, names: Option<&(NameDatabase, NameDatabase)>, ) -> Trade
The activation: every merchant a name (Rand(2): 0 gives a woman’s name, else a man’s)
and no order; every category no automatic trade.
Original: FUN_14005cb80.