Freeciv-3.3: /fast/freeciv/nightly/main/client/cityrepdata.h Source File

Freeciv-3.3

Loading...
Searching...
No Matches
cityrepdata.h
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#ifndef FC__CITYREPDATA_H
14#define FC__CITYREPDATA_H
15
16#ifdef __cplusplus
17extern "C" {
18#endif /* __cplusplus */
19
20/* utility */
21#include "fc_types.h"
22#include "support.h" /* bool type */
23
24/* Number of city report columns: have to set this manually now... */
25#define NUM_CREPORT_COLS (num_city_report_spec())
26
27 struct city_report_spec {
28 bool show; /* Modify this to customize */
29 int width; /* 0 means variable; rightmost only */
30 const char *title1; /* Already translated or NULL */
31 const char *title2; /* Already translated or NULL */
32 const char *explanation; /* Already translated */
33 void *data;
34 const char *(*func)(const struct city *pcity, const void *data);
35 const char *tagname; /* For save_options */
36};
37
38extern struct city_report_spec *city_report_specs;
39
40/* Use tagname rather than index for load/save, because later
41 additions won't necessarily be at the end.
42*/
43
44/* Following are wanted to save/load options; use wrappers rather
45 than expose the grotty details of the city_report_spec:
46 (well, the details are exposed now too, but still keep
47 this "clean" interface...)
48*/
49int num_city_report_spec(void);
50bool *city_report_spec_show_ptr(int i);
51const char *city_report_spec_tagname(int i);
52
53void init_city_report_game_data(void);
54
55int cityrepfield_compare(const char *field1, const char *field2);
56
57bool can_city_sell_universal(const struct city *pcity,
58 const struct universal *target);
59
60#ifdef __cplusplus
61}
62#endif /* __cplusplus */
63
64#endif /* FC__CITYREPDATA_H */
num_city_report_spec
int num_city_report_spec(void)
Definition cityrepdata.c:850
init_city_report_game_data
void init_city_report_game_data(void)
Definition cityrepdata.c:876
can_city_sell_universal
bool can_city_sell_universal(const struct city *pcity, const struct universal *target)
Definition cityrepdata.c:1150
city_report_specs
struct city_report_spec * city_report_specs
Definition cityrepdata.c:844
city_report_spec_tagname
const char * city_report_spec_tagname(int i)
Definition cityrepdata.c:866
cityrepfield_compare
int cityrepfield_compare(const char *field1, const char *field2)
Definition cityrepdata.c:1123
city_report_spec_show_ptr
bool * city_report_spec_show_ptr(int i)
Definition cityrepdata.c:858
incite_cost
char * incite_cost
Definition comments.c:74
fc_types.h
city_report_spec
Definition cityrepdata.h:27
city_report_spec::tagname
const char * tagname
Definition cityrepdata.h:35
city_report_spec::width
int width
Definition cityrepdata.h:29
city_report_spec::title2
const char * title2
Definition cityrepdata.h:31
city_report_spec::data
void * data
Definition cityrepdata.h:33
city_report_spec::show
bool show
Definition cityrepdata.h:28
city_report_spec::explanation
const char * explanation
Definition cityrepdata.h:32
city_report_spec::title1
const char * title1
Definition cityrepdata.h:30
city
Definition city.h:320
universal
Definition fc_types.h:908
support.h