Freeciv-3.3: /fast/freeciv/nightly/main/client/gui-gtk-5.0/gotodlg.c Source File

Freeciv-3.3

Loading...
Searching...
No Matches
gotodlg.c
Go to the documentation of this file.
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)
6 any later version.
7
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***********************************************************************/
13
14#ifdef HAVE_CONFIG_H
15#include <fc_config.h>
16#endif
17
18#include <stdio.h>
19#include <stdlib.h>
20#include <string.h>
21
22#include <gtk/gtk.h>
23#include <gdk/gdkkeysyms.h>
24
25/* utility */
26#include "astring.h"
27#include "fcintl.h"
28#include "log.h"
29#include "support.h"
30
31/* common */
32#include "game.h"
33#include "map.h"
34#include "packets.h"
35#include "player.h"
36#include "unit.h"
37#include "unitlist.h"
38
39/* client */
40#include "client_main.h"
41#include "control.h"
42#include "goto.h"
43#include "options.h"
44#include "text.h"
45
46/* clien/gui-gtk-5.0 */
47#include "plrdlg.h"
48#include "dialogs.h"
49#include "gui_main.h"
50#include "gui_stuff.h"
51#include "mapview.h"
52
53#include "gotodlg.h"
54
55
56 static GtkWidget *dshell = NULL;
57 static GtkWidget *view;
58 static GtkWidget *source;
59 static GtkWidget *all_toggle;
60 static GtkListStore *goto_list_store;
61 static GtkTreeSelection *goto_list_selection;
62 struct tile *original_tile;
63 static bool gotodlg_updating = FALSE;
64
65static void update_goto_dialog(GtkToggleButton *button);
66static void update_source_label(void);
67static void refresh_airlift_column(void);
68static void refresh_airlift_button(void);
69static void goto_selection_callback(GtkTreeSelection *selection, gpointer data);
70
71static struct city *get_selected_city(void);
72
73enum {
74 CMD_AIRLIFT = 1, CMD_GOTO
75};
76
77enum {
78 GD_COL_CITY_ID = 0, /* Not shown if not compiled with --enable-debug. */
79 GD_COL_CITY_NAME,
80 GD_COL_FLAG,
81 GD_COL_NATION,
82 GD_COL_AIRLIFT,
83
84 GD_COL_NUM
85};
86
87/**********************************************************************/
90 static void goto_cmd_callback(GtkWidget *dlg, gint arg)
91{
92 switch (arg) {
93 case GTK_RESPONSE_CANCEL:
94 center_tile_mapcanvas(original_tile);
95 break;
96
97 case CMD_AIRLIFT:
98 {
99 struct city *pdestcity = get_selected_city();
100
101 if (pdestcity) {
102 unit_list_iterate(get_units_in_focus(), punit) {
103 if (unit_can_airlift_to(punit, pdestcity)) {
104 request_unit_airlift(punit, pdestcity);
105 }
106 } unit_list_iterate_end;
107 }
108 }
109 break;
110
111 case CMD_GOTO:
112 {
113 struct city *pdestcity = get_selected_city();
114
115 if (pdestcity) {
116 unit_list_iterate(get_units_in_focus(), punit) {
117 send_goto_tile(punit, pdestcity->tile);
118 } unit_list_iterate_end;
119 }
120 }
121 break;
122
123 default:
124 break;
125 }
126
127 gtk_window_destroy(GTK_WINDOW(dlg));
128 dshell = NULL;
129}
130
131/**********************************************************************/
134 static void create_goto_dialog(void)
135{
136 GtkWidget *sw, *label, *frame, *vbox;
137 GtkCellRenderer *rend;
138 GtkTreeViewColumn *col;
139
140 dshell = gtk_dialog_new_with_buttons(_("Goto/Airlift Unit"),
141 NULL,
142 0,
143 _("_Cancel"),
144 GTK_RESPONSE_CANCEL,
145 _("Air_lift"),
146 CMD_AIRLIFT,
147 _("_Goto"),
148 CMD_GOTO,
149 NULL);
150 setup_dialog(dshell, toplevel);
151 gtk_dialog_set_default_response(GTK_DIALOG(dshell), CMD_GOTO);
152 g_signal_connect(dshell, "destroy",
153 G_CALLBACK(widget_destroyed), &dshell);
154 g_signal_connect(dshell, "response",
155 G_CALLBACK(goto_cmd_callback), NULL);
156
157 source = gtk_label_new("" /* Filled in later */);
158 gtk_label_set_wrap(GTK_LABEL(source), TRUE);
159 gtk_label_set_justify(GTK_LABEL(source), GTK_JUSTIFY_CENTER);
160 gtk_box_insert_child_after(GTK_BOX(gtk_dialog_get_content_area(GTK_DIALOG(dshell))),
161 source, NULL);
162
163 label = g_object_new(GTK_TYPE_LABEL,
164 "use-underline", TRUE,
165 "label", _("Select destination ci_ty"),
166 "xalign", 0.0,
167 "yalign", 0.5,
168 NULL);
169 frame = gtk_frame_new("");
170 gtk_frame_set_label_widget(GTK_FRAME(frame), label);
171 gtk_box_insert_child_after(GTK_BOX(gtk_dialog_get_content_area(GTK_DIALOG(dshell))),
172 frame, NULL);
173
174 vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 6);
175 gtk_frame_set_child(GTK_FRAME(frame), vbox);
176
177 goto_list_store = gtk_list_store_new(GD_COL_NUM, G_TYPE_INT, G_TYPE_STRING,
178 GDK_TYPE_PIXBUF, G_TYPE_STRING,
179 G_TYPE_STRING);
180 gtk_tree_sortable_set_sort_column_id(GTK_TREE_SORTABLE(goto_list_store),
181 GD_COL_CITY_NAME, GTK_SORT_ASCENDING);
182
183 view = gtk_tree_view_new_with_model(GTK_TREE_MODEL(goto_list_store));
184 gtk_widget_set_hexpand(view, TRUE);
185 gtk_widget_set_vexpand(view, TRUE);
186 g_object_unref(goto_list_store);
187 goto_list_selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(view));
188 gtk_tree_view_set_headers_visible(GTK_TREE_VIEW(view), TRUE);
189 gtk_tree_view_set_search_column(GTK_TREE_VIEW(view), GD_COL_CITY_NAME);
190 gtk_tree_view_set_enable_search(GTK_TREE_VIEW(view), TRUE);
191
192 /* Set the mnemonic in the frame label to focus the city list */
193 gtk_label_set_mnemonic_widget(GTK_LABEL(label), view);
194
195#ifdef FREECIV_DEBUG
196 rend = gtk_cell_renderer_text_new();
197 col = gtk_tree_view_column_new_with_attributes(_("Id"), rend,
198 "text", GD_COL_CITY_ID, NULL);
199 gtk_tree_view_append_column(GTK_TREE_VIEW(view), col);
200 gtk_tree_view_column_set_sort_column_id(col, GD_COL_CITY_ID);
201#endif /* FREECIV_DEBUG */
202
203 rend = gtk_cell_renderer_text_new();
204 col = gtk_tree_view_column_new_with_attributes(_("City"), rend,
205 "text", GD_COL_CITY_NAME, NULL);
206 gtk_tree_view_append_column(GTK_TREE_VIEW(view), col);
207 gtk_tree_view_column_set_sort_column_id(col, GD_COL_CITY_NAME);
208
209 rend = gtk_cell_renderer_pixbuf_new();
210 col = gtk_tree_view_column_new_with_attributes(NULL, rend,
211 "pixbuf", GD_COL_FLAG, NULL);
212 gtk_tree_view_append_column(GTK_TREE_VIEW(view), col);
213
214 rend = gtk_cell_renderer_text_new();
215 col = gtk_tree_view_column_new_with_attributes(_("Nation"), rend,
216 "text", GD_COL_NATION,
217 NULL);
218 gtk_tree_view_append_column(GTK_TREE_VIEW(view), col);
219 gtk_tree_view_column_set_sort_column_id(col, GD_COL_NATION);
220
221 rend = gtk_cell_renderer_text_new();
222 col = gtk_tree_view_column_new_with_attributes(_("Airlift"), rend,
223 "text", GD_COL_AIRLIFT,
224 NULL);
225 gtk_tree_view_append_column(GTK_TREE_VIEW(view), col);
226 gtk_tree_view_column_set_sort_column_id(col, GD_COL_AIRLIFT);
227
228 sw = gtk_scrolled_window_new();
229 gtk_scrolled_window_set_child(GTK_SCROLLED_WINDOW(sw), view);
230 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw),
231 GTK_POLICY_NEVER, GTK_POLICY_ALWAYS);
232 gtk_scrolled_window_set_min_content_height(GTK_SCROLLED_WINDOW(sw), 200);
233
234 gtk_box_append(GTK_BOX(vbox), sw);
235
236 all_toggle = gtk_check_button_new_with_mnemonic(_("Show _All Cities"));
237 gtk_box_append(GTK_BOX(vbox), all_toggle);
238
239 g_signal_connect(all_toggle, "toggled",
240 G_CALLBACK(update_goto_dialog), NULL);
241
242 g_signal_connect(goto_list_selection, "changed",
243 G_CALLBACK(goto_selection_callback), NULL);
244
245 gtk_widget_set_visible(dshell, TRUE);
246
247 original_tile = get_center_tile_mapcanvas();
248
249 update_source_label();
250 update_goto_dialog(GTK_TOGGLE_BUTTON(all_toggle));
251 gtk_tree_view_focus(GTK_TREE_VIEW(view));
252}
253
254/**********************************************************************/
257 void popup_goto_dialog(void)
258{
259 if (!can_client_issue_orders() || get_num_units_in_focus() == 0) {
260 return;
261 }
262
263 if (!dshell) {
264 create_goto_dialog();
265 }
266
267 gtk_window_present(GTK_WINDOW(dshell));
268}
269
270/**********************************************************************/
273 static struct city *get_selected_city(void)
274{
275 GtkTreeModel *model;
276 GtkTreeIter it;
277 int city_id;
278
279 if (!gtk_tree_selection_get_selected(goto_list_selection, NULL, &it)) {
280 return NULL;
281 }
282
283 model = gtk_tree_view_get_model(GTK_TREE_VIEW(view));
284
285 gtk_tree_model_get(model, &it, GD_COL_CITY_ID, &city_id, -1);
286
287 return game_city_by_number(city_id);
288}
289
290/**********************************************************************/
293 static bool list_store_append_player_cities(GtkListStore *store,
294 const struct player *pplayer)
295{
296 GtkTreeIter it;
297 struct nation_type *pnation = nation_of_player(pplayer);
298 const char *nation = nation_adjective_translation(pnation);
299 GdkPixbuf *pixbuf;
300
301 if (city_list_size(pplayer->cities) == 0) {
302 return FALSE;
303 }
304
305 pixbuf = get_flag(pnation);
306
307 city_list_iterate(pplayer->cities, pcity) {
308 gtk_list_store_append(store, &it);
309 gtk_list_store_set(store, &it,
310 GD_COL_CITY_ID, pcity->id,
311 GD_COL_CITY_NAME, city_name_get(pcity),
312 GD_COL_FLAG, pixbuf,
313 GD_COL_NATION, nation,
314 /* GD_COL_AIRLIFT is populated later */
315 -1);
316 } city_list_iterate_end;
317 g_object_unref(pixbuf);
318
319 return TRUE;
320}
321
322/**********************************************************************/
326 static void update_source_label(void)
327{
328 /* Arbitrary limit to stop the label getting ridiculously long */
329 static const int max_cities = 10;
330 struct {
331 const struct city *city;
332 struct unit_list *units;
333 } cities[max_cities];
334 int ncities = 0;
335 bool too_many = FALSE;
336 bool no_city = FALSE; /* any units not in a city? */
337 struct astring strs[max_cities];
338 int nstrs;
339 char *last_str;
340 const char *descriptions[max_cities+1];
341 int i;
342
343 /* Sanity check: if no units selected, give up */
344 if (unit_list_size(get_units_in_focus()) == 0) {
345 gtk_label_set_text(GTK_LABEL(source), _("No units selected."));
346 return;
347 }
348
349 /* Divide selected units up into a list of unique cities */
350 unit_list_iterate(get_units_in_focus(), punit) {
351 const struct city *pcity = tile_city(unit_tile(punit));
352 if (pcity) {
353 /* Inefficient, but it's not a long list */
354 for (i = 0; i < ncities; i++) {
355 if (cities[i].city == pcity) {
356 unit_list_append(cities[i].units, punit);
357 break;
358 }
359 }
360 if (i == ncities) {
361 if (ncities < max_cities) {
362 cities[ncities].city = pcity;
363 cities[ncities].units = unit_list_new();
364 unit_list_append(cities[ncities].units, punit);
365 ncities++;
366 } else {
367 too_many = TRUE;
368 break;
369 }
370 }
371 } else {
372 no_city = TRUE;
373 }
374 } unit_list_iterate_end;
375
376 /* Describe the individual cities. */
377 for (i = 0; i < ncities; i++) {
378 const char *air_text = get_airlift_text(cities[i].units, NULL);
379
380 astr_init(&strs[i]);
381 if (air_text != NULL) {
382 astr_add(&strs[i],
383 /* TRANS: goto/airlift dialog. "Paris (airlift: 2/4)".
384 * A set of these appear in an "and"-separated list. */
385 _("%s (airlift: %s)"),
386 city_name_get(cities[i].city), air_text);
387 } else {
388 astr_add(&strs[i], "%s", city_name_get(cities[i].city));
389 }
390 descriptions[i] = astr_str(&strs[i]);
391 unit_list_destroy(cities[i].units);
392 }
393 if (too_many) {
394 /* TRANS: goto/airlift dialog. Too many cities to list, some omitted.
395 * Appears at the end of an "and"-separated list. */
396 descriptions[ncities] = last_str = fc_strdup(Q_("?gotodlg:more"));
397 nstrs = ncities+1;
398 } else if (no_city) {
399 /* TRANS: goto/airlift dialog. For units not currently in a city.
400 * Appears at the end of an "and"-separated list. */
401 descriptions[ncities] = last_str = fc_strdup(Q_("?gotodlg:no city"));
402 nstrs = ncities+1;
403 } else {
404 last_str = NULL;
405 nstrs = ncities;
406 }
407
408 /* Finally, update the label. */
409 {
410 struct astring label = ASTRING_INIT, list = ASTRING_INIT;
411 astr_set(&label,
412 /* TRANS: goto/airlift dialog. Current location of units; %s is an
413 * "and"-separated list of cities and associated info */
414 _("Currently in: %s"),
415 astr_build_and_list(&list, descriptions, nstrs));
416 astr_free(&list);
417 gtk_label_set_text(GTK_LABEL(source), astr_str(&label));
418 astr_free(&label);
419 }
420
421 /* Clear up. */
422 for (i = 0; i < ncities; i++) {
423 astr_free(&strs[i]);
424 }
425 free(last_str); /* might have been NULL */
426}
427
428/**********************************************************************/
431 static void update_goto_dialog(GtkToggleButton *button)
432{
433 bool nonempty = FALSE;
434
435 if (!client_has_player()) {
436 /* Case global observer. */
437 return;
438 }
439
440 gotodlg_updating = TRUE;
441
442 gtk_list_store_clear(goto_list_store);
443
444 if (gtk_toggle_button_get_active(button)) {
445 players_iterate(pplayer) {
446 nonempty |= list_store_append_player_cities(goto_list_store, pplayer);
447 } players_iterate_end;
448 } else {
449 nonempty |= list_store_append_player_cities(goto_list_store, client_player());
450 }
451
452 gotodlg_updating = FALSE;
453
454 refresh_airlift_column();
455
456 if (!nonempty) {
457 /* No selection causes callbacks to fire, causing also Airlift button
458 * to update. Do it here. */
459 refresh_airlift_button();
460 }
461}
462
463/**********************************************************************/
466 static void refresh_airlift_column(void)
467{
468 GtkTreeIter iter;
469 bool valid;
470
471 valid = gtk_tree_model_get_iter_first(GTK_TREE_MODEL(goto_list_store), &iter);
472 while (valid) {
473 int city_id;
474 const struct city *pcity;
475 const char *air_text;
476
477 gtk_tree_model_get(GTK_TREE_MODEL(goto_list_store), &iter,
478 GD_COL_CITY_ID, &city_id, -1);
479 pcity = game_city_by_number(city_id);
480 fc_assert_ret(pcity != NULL);
481 air_text = get_airlift_text(get_units_in_focus(), pcity);
482 gtk_list_store_set(GTK_LIST_STORE(goto_list_store), &iter,
483 GD_COL_AIRLIFT, air_text ? air_text : "-", -1);
484 valid = gtk_tree_model_iter_next(GTK_TREE_MODEL(goto_list_store), &iter);
485 }
486}
487
488/**********************************************************************/
492 static void refresh_airlift_button(void)
493{
494 struct city *pdestcity = get_selected_city();
495
496 if (NULL != pdestcity) {
497 bool can_airlift = FALSE;
498
499 /* Allow action if any of the selected units can airlift. */
500 unit_list_iterate(get_units_in_focus(), punit) {
501 if (unit_can_airlift_to(punit, pdestcity)) {
502 can_airlift = TRUE;
503 break;
504 }
505 } unit_list_iterate_end;
506
507 if (can_airlift) {
508 gtk_dialog_set_response_sensitive(GTK_DIALOG(dshell),
509 CMD_AIRLIFT, TRUE);
510 return;
511 }
512 }
513 gtk_dialog_set_response_sensitive(GTK_DIALOG(dshell), CMD_AIRLIFT, FALSE);
514}
515
516/**********************************************************************/
520 static void goto_selection_callback(GtkTreeSelection *selection,
521 gpointer data)
522{
523 struct city *pdestcity;
524
525 if (gotodlg_updating) {
526 return;
527 }
528
529 pdestcity = get_selected_city();
530
531 if (NULL != pdestcity) {
532 center_tile_mapcanvas(city_tile(pdestcity));
533 }
534 refresh_airlift_button();
535}
536
537/**********************************************************************/
540 void goto_dialog_focus_units_changed(void)
541{
542 /* Is the dialog currently being displayed? */
543 if (dshell) {
544 /* Location of current units and ability to airlift may have changed */
545 update_source_label();
546 refresh_airlift_column();
547 refresh_airlift_button();
548 }
549}
astr_free
void astr_free(struct astring *astr)
Definition astring.c:148
astr_set
void astr_set(struct astring *astr, const char *format,...)
Definition astring.c:251
astr_build_and_list
const char * astr_build_and_list(struct astring *astr, const char *const *items, size_t number)
Definition astring.c:351
astr_init
void astr_init(struct astring *astr)
Definition astring.c:139
astr_add
void astr_add(struct astring *astr, const char *format,...)
Definition astring.c:271
astring.h
astr_str
static const char * astr_str(const struct astring *astr) fc__attribute((nonnull(1)))
Definition astring.h:93
ASTRING_INIT
#define ASTRING_INIT
Definition astring.h:44
city_name_get
const char * city_name_get(const struct city *pcity)
Definition city.c:1128
city_list_iterate
#define city_list_iterate(citylist, pcity)
Definition city.h:508
city_tile
#define city_tile(_pcity_)
Definition city.h:564
city_list_iterate_end
#define city_list_iterate_end
Definition city.h:510
can_client_issue_orders
bool can_client_issue_orders(void)
Definition client_main.c:1264
client_has_player
bool client_has_player(void)
Definition client_main.c:1364
client_main.h
client_player
#define client_player()
Definition client_main.h:106
list
static struct fc_sockaddr_list * list
Definition clinet.c:102
incite_cost
char * incite_cost
Definition comments.c:74
request_unit_airlift
void request_unit_airlift(struct unit *punit, struct city *pcity)
Definition control.c:1517
get_units_in_focus
struct unit_list * get_units_in_focus(void)
Definition control.c:177
get_num_units_in_focus
int get_num_units_in_focus(void)
Definition control.c:185
control.h
punit
struct unit struct city struct unit struct tile struct extra_type const struct act_prob *act_probs int actor_unit_id struct unit struct unit * punit
Definition dialogs_g.h:74
fcintl.h
Q_
#define Q_(String)
Definition fcintl.h:70
_
#define _(String)
Definition fcintl.h:67
game_city_by_number
struct city * game_city_by_number(int id)
Definition game.c:107
game.h
send_goto_tile
bool send_goto_tile(struct unit *punit, struct tile *ptile)
Definition goto.c:1559
goto.h
goto_list_store
static GtkListStore * goto_list_store
Definition gotodlg.c:60
update_source_label
static void update_source_label(void)
Definition gotodlg.c:327
goto_cmd_callback
static void goto_cmd_callback(GtkWidget *dlg, gint arg)
Definition gotodlg.c:90
goto_list_selection
static GtkTreeSelection * goto_list_selection
Definition gotodlg.c:61
refresh_airlift_column
static void refresh_airlift_column(void)
Definition gotodlg.c:467
goto_dialog_focus_units_changed
void goto_dialog_focus_units_changed(void)
Definition gotodlg.c:541
original_tile
struct tile * original_tile
Definition gotodlg.c:62
popup_goto_dialog
void popup_goto_dialog(void)
Definition gotodlg.c:258
CMD_AIRLIFT
@ CMD_AIRLIFT
Definition gotodlg.c:74
CMD_GOTO
@ CMD_GOTO
Definition gotodlg.c:74
dshell
static GtkWidget * dshell
Definition gotodlg.c:56
list_store_append_player_cities
static bool list_store_append_player_cities(GtkListStore *store, const struct player *pplayer)
Definition gotodlg.c:294
all_toggle
static GtkWidget * all_toggle
Definition gotodlg.c:59
gotodlg_updating
static bool gotodlg_updating
Definition gotodlg.c:63
get_selected_city
static struct city * get_selected_city(void)
Definition gotodlg.c:274
GD_COL_CITY_ID
@ GD_COL_CITY_ID
Definition gotodlg.c:78
GD_COL_FLAG
@ GD_COL_FLAG
Definition gotodlg.c:80
GD_COL_AIRLIFT
@ GD_COL_AIRLIFT
Definition gotodlg.c:82
GD_COL_NATION
@ GD_COL_NATION
Definition gotodlg.c:81
GD_COL_CITY_NAME
@ GD_COL_CITY_NAME
Definition gotodlg.c:79
GD_COL_NUM
@ GD_COL_NUM
Definition gotodlg.c:84
refresh_airlift_button
static void refresh_airlift_button(void)
Definition gotodlg.c:493
source
static GtkWidget * source
Definition gotodlg.c:58
view
static GtkWidget * view
Definition gotodlg.c:57
create_goto_dialog
static void create_goto_dialog(void)
Definition gotodlg.c:135
goto_selection_callback
static void goto_selection_callback(GtkTreeSelection *selection, gpointer data)
Definition gotodlg.c:521
toplevel
GtkWidget * toplevel
Definition gui_main.c:125
gtk_tree_view_focus
void gtk_tree_view_focus(GtkTreeView *view)
Definition gui_stuff.c:236
setup_dialog
void setup_dialog(GtkWidget *shell, GtkWidget *parent)
Definition gui_stuff.c:287
get_flag
GdkPixbuf * get_flag(const struct nation_type *nation)
Definition plrdlg.c:607
widget_destroyed
void widget_destroyed(GtkWidget *wdg, void *data)
Definition gui_stuff.c:1155
gui_stuff.h
update_goto_dialog
static void update_goto_dialog(void)
Definition gotodlg.c:135
dialogs.h
gotodlg.h
gui_main.h
mapview.h
plrdlg.h
log.h
fc_assert_ret
#define fc_assert_ret(condition)
Definition log.h:191
map.h
get_center_tile_mapcanvas
struct tile * get_center_tile_mapcanvas(void)
Definition mapview_common.c:1227
center_tile_mapcanvas
void center_tile_mapcanvas(const struct tile *ptile)
Definition mapview_common.c:1237
fc_strdup
#define fc_strdup(str)
Definition mem.h:43
nation_adjective_translation
const char * nation_adjective_translation(const struct nation_type *pnation)
Definition nation.c:149
nation_of_player
struct nation_type * nation_of_player(const struct player *pplayer)
Definition nation.c:444
options.h
packets.h
cities
struct city_list * cities
Definition packhand.c:119
player.h
players_iterate_end
#define players_iterate_end
Definition player.h:539
players_iterate
#define players_iterate(_pplayer)
Definition player.h:534
astring
Definition astring.h:36
city
Definition city.h:320
nation_type
Definition nation.h:98
player
Definition player.h:249
player::cities
struct city_list * cities
Definition player.h:281
tile
Definition tile.h:50
unit::tile
struct tile * tile
Definition unit.h:142
view
Definition mapview_common.h:36
support.h
TRUE
#define TRUE
Definition support.h:46
FALSE
#define FALSE
Definition support.h:47
get_airlift_text
const char * get_airlift_text(const struct unit_list *punits, const struct city *pdest)
Definition text.c:558
text.h
tile_city
struct city * tile_city(const struct tile *ptile)
Definition tile.c:83
unit_can_airlift_to
bool unit_can_airlift_to(const struct unit *punit, const struct city *pdest_city)
Definition unit.c:186
unit.h
unit_tile
#define unit_tile(_pu)
Definition unit.h:397
unitlist.h
unit_list_iterate
#define unit_list_iterate(unitlist, punit)
Definition unitlist.h:31
unit_list_iterate_end
#define unit_list_iterate_end
Definition unitlist.h:33