~ubuntu-branches/debian/squeeze/freeciv/squeeze

« back to all changes in this revision

Viewing changes to common/nation.h

  • Committer: Bazaar Package Importer
  • Author(s): Clint Adams, Karl Goetz, Clint Adams
  • Date: 2010-02-23 22:09:02 UTC
  • mfrom: (1.2.13 upstream)
  • Revision ID: james.westby@ubuntu.com-20100223220902-kiyrmr9i4152cka5
Tags: 2.2.0-1
[ Karl Goetz ]
* Remove civserver files in /etc/ggzd/ (Closes: 523772, 517787)
* Adding ${misc:Depends} to all binary packages (lintian warnings)

[ Clint Adams ]
* New upstream version.
  - Drop data_dsc_use_bindir.diff (binary pathnames have changed).

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
/* Changing this value will break network compatibility. */
24
24
#define NO_NATION_SELECTED (NULL)
25
25
 
 
26
#define NATION_NONE -1
 
27
#define NATION_ANY  -2
 
28
 
26
29
/* 
27
30
 * Purpose of this constant is to catch invalid ruleset and network
28
31
 * data and to allow static allocation of the nation_info packet.
69
72
 
70
73
/* Pointer values are allocated on load then freed in free_nations(). */
71
74
struct nation_type {
72
 
  Nation_type_id index;
 
75
  Nation_type_id item_number;
73
76
  struct name_translation adjective;
74
77
  struct name_translation noun_plural;
75
78
  char flag_graphic_str[MAX_LEN_NAME];
80
83
  struct nation_city *city_names;       /* The default city names. */
81
84
  char *legend;                         /* may be empty */
82
85
 
83
 
  bool is_playable, is_barbarian;
 
86
  bool is_playable;
 
87
  enum barbarian_type barb_type;
84
88
 
85
89
  /* civilwar_nations is a NO_NATION_SELECTED-terminated list of index of
86
90
   * the nations that can fork from this one.  parent_nations is the inverse
133
137
 
134
138
/* Ancillary nation routines */
135
139
bool is_nation_playable(const struct nation_type *nation);
136
 
bool is_nation_barbarian(const struct nation_type *nation);
 
140
enum barbarian_type nation_barbarian_type(const struct nation_type *nation);
137
141
bool can_conn_edit_players_nation(const struct connection *pconn,
138
142
                                  const struct player *pplayer);
139
143
 
179
183
void nations_free(void);
180
184
void nation_city_names_free(struct nation_city *city_names);
181
185
 
182
 
struct nation_type *nation_array_first(void);
183
 
const struct nation_type *nation_array_last(void);
 
186
#include "iterator.h"
 
187
struct nation_iter;
 
188
size_t nation_iter_sizeof(void);
 
189
struct iterator *nation_iter_init(struct nation_iter *it);
184
190
 
185
191
/* Iterate over nations.  This iterates over all nations, including
186
192
 * unplayable ones (use is_nation_playable to filter if necessary). */
187
 
#define nations_iterate(_p)                                             \
188
 
{                                                                       \
189
 
  struct nation_type *_p = nation_array_first();                        \
190
 
  if (NULL != _p) {                                                     \
191
 
    for (; _p <= nation_array_last(); _p++) {
192
 
 
193
 
#define nations_iterate_end                                             \
194
 
    }                                                                   \
195
 
  }                                                                     \
196
 
}
 
193
#define nations_iterate(NAME_pnation)\
 
194
  generic_iterate(struct nation_iter, struct nation_type *,\
 
195
                  NAME_pnation, nation_iter_sizeof, nation_iter_init)
 
196
#define nations_iterate_end generic_iterate_end
197
197
 
198
198
#endif  /* FC__NATION_H */