1 /***********************************************************************
2 Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold
3 This program is free software; you can redistribute it and/or modify
4 it under the terms of the GNU General Public License as published by
5 the Free Software Foundation; either version 2, or (at your option)
8 This program is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 GNU General Public License for more details.
12 ***********************************************************************/
18 #endif /* __cplusplus */
22 #include "featured_text.h" /* struct ft_color */
33 void client_remove_player(int plrno
);
34 void client_remove_city(struct city
*pcity
);
35 void client_remove_unit(struct unit
*punit
);
37 void client_change_all(struct universal
*from
,
38 struct universal
*to
);
40 const char *get_embassy_status(const struct player
*me
,
41 const struct player
*them
);
42 const char *get_vision_status(const struct player
*me
,
43 const struct player
*them
);
44 void client_diplomacy_clause_string(char *buf
, int bufsiz
,
45 struct Clause
*pclause
);
47 void global_warming_scaled(int *chance
, int *rate
, int max
);
48 void nuclear_winter_scaled(int *chance
, int *rate
, int max
);
50 struct sprite
*client_research_sprite(void);
51 struct sprite
*client_warming_sprite(void);
52 struct sprite
*client_cooling_sprite(void);
53 struct sprite
*client_government_sprite(void);
55 void center_on_something(void);
58 * A compound id (cid) can hold all objects a city can build:
59 * improvements (with wonders) and units. This is achieved by
60 * seperation the value set: a cid < B_LAST denotes a improvement
61 * (including wonders). A cid >= B_LAST denotes a unit with the
62 * unit_type_id of (cid - B_LAST).
65 cid
cid_encode(struct universal target
);
66 cid
cid_encode_unit(struct unit_type
*punittype
);
67 cid
cid_encode_building(struct impr_type
*pimprove
);
68 cid
cid_encode_from_city(const struct city
*pcity
);
70 struct universal
cid_decode(cid cid
);
71 #define cid_production cid_decode
73 bool city_unit_supported(const struct city
*pcity
,
74 const struct universal
*target
);
75 bool city_unit_present(const struct city
*pcity
,
76 const struct universal
*target
);
77 bool city_building_present(const struct city
*pcity
,
78 const struct universal
*target
);
81 struct universal item
;
82 char descr
[MAX_LEN_NAME
+ 40];
85 typedef bool (*TestCityFunc
)(const struct city
*, const struct universal
*);
87 #define MAX_NUM_PRODUCTION_TARGETS (U_LAST + B_LAST)
88 void name_and_sort_items(struct universal
*targets
, int num_items
,
90 bool show_cost
, struct city
*pcity
);
91 int collect_production_targets(struct universal
*targets
,
92 struct city
**selected_cities
,
93 int num_selected_cities
, bool append_units
,
94 bool append_wonders
, bool change_prod
,
95 TestCityFunc test_func
);
96 int collect_currently_building_targets(struct universal
*targets
);
97 int collect_buildable_targets(struct universal
*targets
);
98 int collect_eventually_buildable_targets(struct universal
*targets
,
101 int collect_already_built_targets(struct universal
*targets
,
104 /* the number of units in city */
105 int num_present_units_in_city(struct city
* pcity
);
106 int num_supported_units_in_city(struct city
* pcity
);
108 void handle_event(const char *featured_text
, struct tile
*ptile
,
109 enum event_type event
, int turn
, int phase
, int conn_id
);
110 void create_event(struct tile
*ptile
, enum event_type event
,
111 const struct ft_color color
, const char *format
, ...)
112 fc__attribute((__format__ (__printf__
, 4, 5)));
114 struct city
*get_nearest_city(const struct unit
*punit
, int *sq_dist
);
116 void cityrep_buy(struct city
*pcity
);
117 void common_taxrates_callback(int i
);
119 bool can_units_do_connect(struct unit_list
*punits
,
120 enum unit_activity activity
,
121 struct extra_type
*tgt
);
123 bool can_unit_act_against_own_tile(struct unit
*punit
);
124 bool can_units_act_against_own_tile(struct unit_list
*punits
);
126 void client_unit_init_act_prob_cache(struct unit
*punit
);
128 enum unit_bg_color_type
{ UNIT_BG_HP_LOSS
,
134 enum unit_bg_color_type
unit_color_type(const struct unit_type
*punittype
);
136 void buy_production_in_selected_cities(void);
138 void unit_focus_set_status(struct player
*pplayer
);
140 void client_player_init(struct player
*pplayer
);
142 void client_player_maps_reset(void);
144 bool mapimg_client_define(void);
145 bool mapimg_client_createmap(const char *filename
);
147 struct nation_set
*client_current_nation_set(void);
148 bool client_nation_is_in_current_set(const struct nation_type
*pnation
);
152 #endif /* __cplusplus */
154 #endif /* FC__CLIMISC_H */