1 #ifndef EMPIRE_OBJECT_H
2 #define EMPIRE_OBJECT_H
3 
4 #include "core/buffer.h"
5 
6 typedef struct {
7     int id;
8     int type;
9     int animation_index;
10     int x;
11     int y;
12     int width;
13     int height;
14     int image_id;
15     struct {
16         int x;
17         int y;
18         int image_id;
19     } expanded;
20     int distant_battle_travel_months;
21     int trade_route_id;
22     int invasion_path_id;
23     int invasion_years;
24 } empire_object;
25 
26 void empire_object_load(buffer *buf);
27 
28 void empire_object_init_cities(void);
29 
30 int empire_object_init_distant_battle_travel_months(int object_type);
31 
32 const empire_object *empire_object_get(int object_id);
33 
34 const empire_object *empire_object_get_our_city(void);
35 
36 void empire_object_foreach(void (*callback)(const empire_object *));
37 
38 const empire_object *empire_object_get_battle_icon(int path_id, int year);
39 
40 int empire_object_get_max_invasion_path(void);
41 
42 int empire_object_get_closest(int x, int y);
43 
44 void empire_object_set_expanded(int object_id, int new_city_type);
45 
46 int empire_object_city_buys_resource(int object_id, int resource);
47 int empire_object_city_sells_resource(int object_id, int resource);
48 
49 int empire_object_update_animation(const empire_object *obj, int image_id);
50 
51 #endif // EMPIRE_OBJECT_H
52