1 #ifndef EMPIRE_TRADE_PRICES_H
2 #define EMPIRE_TRADE_PRICES_H
3 
4 #include "core/buffer.h"
5 #include "game/resource.h"
6 
7 /**
8  * @file
9  * Trade prices.
10  */
11 
12 /**
13  * Reset trade prices to the default
14  */
15 void trade_prices_reset(void);
16 
17 /**
18  * Get the buy price for the resource
19  * @param resource Resource
20  */
21 int trade_price_buy(resource_type resource);
22 
23 /**
24  * Get the sell price for the resource
25  * @param resource Resource
26  */
27 int trade_price_sell(resource_type resource);
28 
29 /**
30  * Change the trade price for resource by amount
31  * @param resource Resource to change
32  * @param amount Amount to change, can be positive or negative
33  * @return True if the price has been changed
34  */
35 int trade_price_change(resource_type resource, int amount);
36 
37 /**
38  * Save trade prices to buffer
39  * @param buf Buffer
40  */
41 void trade_prices_save_state(buffer *buf);
42 
43 /**
44  * Load trade prices from buffer
45  * @param buf Buffer
46  */
47 void trade_prices_load_state(buffer *buf);
48 
49 #endif // EMPIRE_TRADE_PRICES_H
50