Freeciv-3.1: /fast/freeciv/nightly/S3_1/common/requirements.h Source File

Freeciv-3.1

Loading...
Searching...
No Matches
requirements.h
Go to the documentation of this file.
1/***********************************************************************
2 Freeciv - Copyright (C) 1996-2004 - The Freeciv Project
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#ifndef FC__REQUIREMENTS_H
15#define FC__REQUIREMENTS_H
16
17#ifdef __cplusplus
18extern "C" {
19#endif /* __cplusplus */
20
21/* utility */
22#include "astring.h"
23
24/* common */
25#include "fc_types.h"
26#include "map_types.h"
27
28/* Range of requirements.
29 * Used in the network protocol.
30 * Order is important -- wider ranges should come later -- some code
31 * assumes a total order, or tests for e.g. >= REQ_RANGE_PLAYER.
32 * Ranges of similar types should be supersets, for example:
33 * - the set of Adjacent tiles contains the set of CAdjacent tiles,
34 * and both contain the center Local tile (a requirement on the local
35 * tile is also within Adjacent range);
36 * - World contains Alliance contains Player (a requirement we ourselves
37 * have is also within Alliance range). */
38#define SPECENUM_NAME req_range
39#define SPECENUM_VALUE0 REQ_RANGE_LOCAL
40#define SPECENUM_VALUE0NAME "Local"
41#define SPECENUM_VALUE1 REQ_RANGE_CADJACENT
42#define SPECENUM_VALUE1NAME "CAdjacent"
43#define SPECENUM_VALUE2 REQ_RANGE_ADJACENT
44#define SPECENUM_VALUE2NAME "Adjacent"
45#define SPECENUM_VALUE3 REQ_RANGE_CITY
46#define SPECENUM_VALUE3NAME "City"
47#define SPECENUM_VALUE4 REQ_RANGE_TRADE_ROUTE
48/* FIXME: -> "Trade Route" */
49#define SPECENUM_VALUE4NAME "Traderoute"
50#define SPECENUM_VALUE5 REQ_RANGE_CONTINENT
51#define SPECENUM_VALUE5NAME "Continent"
52#define SPECENUM_VALUE6 REQ_RANGE_PLAYER
53#define SPECENUM_VALUE6NAME "Player"
54#define SPECENUM_VALUE7 REQ_RANGE_TEAM
55#define SPECENUM_VALUE7NAME "Team"
56#define SPECENUM_VALUE8 REQ_RANGE_ALLIANCE
57#define SPECENUM_VALUE8NAME "Alliance"
58#define SPECENUM_VALUE9 REQ_RANGE_WORLD
59#define SPECENUM_VALUE9NAME "World"
60#define SPECENUM_COUNT REQ_RANGE_COUNT /* Keep this last */
61#define REQ_RANGE_MAX (REQ_RANGE_COUNT - 1) /* REQ_RANGE_WORLD */
62#include "specenum_gen.h"
63
64#define req_range_iterate(_range_) \
65 { \
66 enum req_range _range_; \
67 for (_range_ = REQ_RANGE_LOCAL ; _range_ < REQ_RANGE_COUNT ; \
68 _range_ = (enum req_range)(_range_ + 1)) {
69
70#define req_range_iterate_end \
71 } \
72 }
73
74/* A requirement. This requirement is basically a conditional; it may or
75 * may not be active on a target. If it is active then something happens.
76 * For instance units and buildings have requirements to be built, techs
77 * have requirements to be researched, and effects have requirements to be
78 * active.
79 * Used in the network protocol. */
80 struct requirement {
81 struct universal source; /* requirement source */
82 enum req_range range; /* requirement range */
83 bool survives; /* set if destroyed sources satisfy the req*/
84 bool present; /* set if the requirement is to be present */
85 bool quiet; /* do not list this in helptext */
86};
87
88#define SPECVEC_TAG requirement
89#define SPECVEC_TYPE struct requirement
90#include "specvec.h"
91#define requirement_vector_iterate(req_vec, preq) \
92 TYPED_VECTOR_ITERATE(struct requirement, req_vec, preq)
93#define requirement_vector_iterate_end VECTOR_ITERATE_END
94
95/* A set of targets to evaluate requirements against. Depending on what the
96 * requirements in question are for, most of these entries will usually be
97 * NULL. For instance, when evaluating the construction requirements for a
98 * building, there is no target unit, specialist etc. */
99 struct req_context {
100 const struct player *player;
101 const struct city *city;
102 const struct tile *tile;
103
104 /* for local-ranged requirements only */
105 const struct unit *unit;
106 const struct unit_type *unittype;
107 const struct impr_type *building;
108 const struct output_type *output;
109 const struct specialist *specialist;
110 const struct action *action;
111};
112
113 enum req_unchanging_status {
114 REQUCH_NO = 0, /* Changes regularly */
115 REQUCH_CTRL, /* Can't be changed by game means as long as target player
116 * is in control of target city or unit */
117 REQUCH_ACT, /* Can't be easily changed by expected player's activity
118 * (without destroying teammates, inducing global warming...) */
119 REQUCH_SCRIPTS, /* May be changed by script callbacks */
120 REQUCH_HACK, /* May be changed by server commands/editor */
121 REQUCH_YES /* Really never changes unless savegame is edited */
122};
123
124/* A callback that may transform kind-specific default unchanging status
125 * to another one (usually higher but not always)
126 * Passing other_player is just not needed for it in any known cases */
127typedef enum req_unchanging_status
128 (*req_unchanging_cond_cb)(const struct civ_map *nmap,
129 enum req_unchanging_status def,
130 const struct req_context *context,
131 const struct requirement *req);
132
133/* req_context-related functions */
134const struct req_context *req_context_empty(void);
135
136/* General requirement functions. */
137struct requirement req_from_str(const char *type, const char *range,
138 bool survives, bool present, bool quiet,
139 const char *value);
140const char *req_to_fstring(const struct requirement *req,
141 struct astring *astr);
142
143void req_get_values(const struct requirement *req, int *type,
144 int *range, bool *survives, bool *present, bool *quiet,
145 int *value);
146struct requirement req_from_values(int type, int range,
147 bool survives, bool present, bool quiet,
148 int value);
149
150void req_copy(struct requirement *dst, const struct requirement *src);
151
152bool are_requirements_equal(const struct requirement *req1,
153 const struct requirement *req2);
154
155bool are_requirements_contradictions(const struct requirement *req1,
156 const struct requirement *req2);
157
158bool req_implies_req(const struct requirement *req1,
159 const struct requirement *req2);
160
161bool does_req_contradicts_reqs(const struct requirement *req,
162 const struct requirement_vector *vec);
163
164enum fc_tristate tri_req_active(const struct req_context *context,
165 const struct player *other_player,
166 const struct requirement *req);
167bool is_req_active(const struct req_context *context,
168 const struct player *other_player,
169 const struct requirement *req,
170 const enum req_problem_type prob_type);
171bool are_reqs_active(const struct req_context *context,
172 const struct player *other_player,
173 const struct requirement_vector *reqs,
174 const enum req_problem_type prob_type);
175
176enum fc_tristate
177 tri_req_active_turns(int pass, int period,
178 const struct req_context *context,
179 const struct player *other_player,
180 const struct requirement *req);
181
182/* Type of a callback that tests requirements due to a context
183 * and something else in some manner different from tri_req_active() */
184typedef enum fc_tristate
185 (*req_tester_cb)(const struct req_context *context,
186 const struct player *other_player,
187 const struct requirement *req,
188 void *data, int n_data);
189
190enum fc_tristate
191 default_tester_cb(const struct req_context *context,
192 const struct player *other_player,
193 const struct requirement *req,
194 void *data, int n_data);
195enum fc_tristate
196 tri_reqs_cb_active(const struct req_context *context,
197 const struct player *other_player,
198 const struct requirement_vector *reqs,
199 struct requirement_vector *maybe_reqs,
200 req_tester_cb tester,
201 void *data, int n_data);
202
203enum req_unchanging_status
204 is_req_unchanging(const struct req_context *context,
205 const struct requirement *req);
206enum req_unchanging_status
207 is_req_preventing(const struct req_context *context,
208 const struct player *other_player,
209 const struct requirement *req,
210 enum req_problem_type prob_type);
211
212bool is_req_in_vec(const struct requirement *req,
213 const struct requirement_vector *vec);
214
215bool req_vec_wants_type(const struct requirement_vector *reqs,
216 enum universals_n kind);
217
218bool universal_never_there(const struct universal *source);
219bool req_is_impossible_to_fulfill(const struct requirement *req);
220bool req_vec_is_impossible_to_fulfill(const struct requirement_vector *reqs);
221
229 typedef signed char req_vec_num_in_item;
230
231/**********************************************************************/
239 typedef req_vec_num_in_item
240(*requirement_vector_number)(const void *parent_item,
241 const struct requirement_vector *vec);
242
243/********************************************************************/
251typedef struct requirement_vector *
252(*requirement_vector_by_number)(const void *parent_item,
253 req_vec_num_in_item number);
254
255/*********************************************************************/
262 typedef const char *(*requirement_vector_namer)(req_vec_num_in_item number);
263
264 req_vec_num_in_item
265 req_vec_vector_number(const void *parent_item,
266 const struct requirement_vector *vec);
267struct requirement_vector *
268 req_vec_by_number(const void *parent_item, req_vec_num_in_item number);
269
270/* Interactive friendly requirement vector change suggestions and
271 * reasoning. */
272#define SPECENUM_NAME req_vec_change_operation
273#define SPECENUM_VALUE0 RVCO_REMOVE
274#define SPECENUM_VALUE0NAME N_("Remove")
275#define SPECENUM_VALUE1 RVCO_APPEND
276#define SPECENUM_VALUE1NAME N_("Append")
277#define SPECENUM_COUNT RVCO_NOOP
278#include "specenum_gen.h"
279
280 struct req_vec_change {
281 enum req_vec_change_operation operation;
282 struct requirement req;
283
284 req_vec_num_in_item vector_number;
285};
286
287 struct req_vec_problem {
288 /* Can't use name_translation because it is MAX_LEN_NAME long and a
289 * description may contain more than one name. */
290 char description[500];
291 char description_translated[500];
292
293 int num_suggested_solutions;
294 struct req_vec_change *suggested_solutions;
295};
296
297const char *req_vec_change_translation(const struct req_vec_change *change,
298 const requirement_vector_namer namer);
299
300bool req_vec_change_apply(const struct req_vec_change *modification,
301 requirement_vector_by_number getter,
302 const void *parent_item);
303
304struct req_vec_problem *req_vec_problem_new(int num_suggested_solutions,
305 const char *description, ...);
306struct req_vec_problem *
307 req_vec_problem_new_transl(int num_suggested_solutions,
308 const char *description,
309 const char *description_translated);
310void req_vec_problem_free(struct req_vec_problem *issue);
311
312struct req_vec_problem *
313 req_vec_get_first_contradiction(const struct requirement_vector *vec,
314 requirement_vector_number get_num,
315 const void *parent_item);
316struct req_vec_problem *
317 req_vec_suggest_repair(const struct requirement_vector *vec,
318 requirement_vector_number get_num,
319 const void *parent_item);
320struct req_vec_problem *
321 req_vec_get_first_missing_univ(const struct requirement_vector *vec,
322 requirement_vector_number get_num,
323 const void *parent_item);
324struct req_vec_problem *
325 req_vec_get_first_redundant_req(const struct requirement_vector *vec,
326 requirement_vector_number get_num,
327 const void *parent_item);
328struct req_vec_problem *
329 req_vec_suggest_improvement(const struct requirement_vector *vec,
330 requirement_vector_number get_num,
331 const void *parent_item);
332
333
334/* General universal functions. */
335int universal_number(const struct universal *source);
336
337struct universal universal_by_number(const enum universals_n kind,
338 const int value);
339struct universal universal_by_rule_name(const char *kind,
340 const char *value);
341void universal_value_from_str(struct universal *source, const char *value);
342void universal_copy(struct universal *dst, const struct universal *src);
343void universal_extraction(const struct universal *source,
344 int *kind, int *value);
345
346bool are_universals_equal(const struct universal *psource1,
347 const struct universal *psource2);
348
349const char *universal_rule_name(const struct universal *psource);
350const char *universal_name_translation(const struct universal *psource,
351 char *buf, size_t bufsz);
352const char *universal_type_rule_name(const struct universal *psource);
353
354int universal_build_shield_cost(const struct city *pcity,
355 const struct universal *target);
356
357bool universal_replace_in_req_vec(struct requirement_vector *reqs,
358 const struct universal *to_replace,
359 const struct universal *replacement);
360
361bool universal_is_legal_in_requirement(const struct universal *univ);
362
363#define universal_is_mentioned_by_requirement(preq, psource) \
364 are_universals_equal(&preq->source, psource)
365bool universal_is_mentioned_by_requirements(
366 const struct requirement_vector *reqs,
367 const struct universal *psource);
368
369/* An item contradicts, fulfills or is irrelevant to the requirement */
370 enum req_item_found {ITF_NO, ITF_YES, ITF_NOT_APPLICABLE};
371
372void universal_found_functions_init(void);
373enum req_item_found
374 universal_fulfills_requirement(const struct requirement *preq,
375 const struct universal *source);
376bool universal_fulfills_requirements(bool check_necessary,
377 const struct requirement_vector *reqs,
378 const struct universal *source);
379bool universal_is_relevant_to_requirement(const struct requirement *req,
380 const struct universal *source);
381bool universals_mean_unfulfilled(struct requirement_vector *reqs,
382 struct universal *unis,
383 size_t n_unis);
384bool universals_say_everything(struct requirement_vector *reqs,
385 struct universal *unis,
386 size_t n_unis);
387
388#define universals_iterate(_univ_) \
389 { \
390 enum universals_n _univ_; \
391 for (_univ_ = VUT_NONE; _univ_ < VUT_COUNT; _univ_ = (enum universals_n)(_univ_ + 1)) {
392
393#define universals_iterate_end \
394 } \
395 }
396
397/* Accessors to determine if a universal fulfills a requirement vector.
398 * When adding an additional accessor, be sure to add the appropriate
399 * item_found function in universal_found_functions_init(). */
400/* XXX Some versions of g++ can't cope with the struct literals */
401#define requirement_fulfilled_by_government(_gov_, _rqs_) \
402 universal_fulfills_requirements(FALSE, (_rqs_), \
403 &(struct universal){.kind = VUT_GOVERNMENT, .value = {.govern = (_gov_)}})
404#define requirement_fulfilled_by_nation(_nat_, _rqs_) \
405 universal_fulfills_requirements(FALSE, (_rqs_), \
406 &(struct universal){.kind = VUT_NATION, .value = {.nation = (_nat_)}})
407#define requirement_fulfilled_by_improvement(_imp_, _rqs_) \
408 universal_fulfills_requirements(FALSE, (_rqs_), \
409 &(struct universal){.kind = VUT_IMPROVEMENT, \
410 .value = {.building = (_imp_)}})
411#define requirement_fulfilled_by_terrain(_ter_, _rqs_) \
412 universal_fulfills_requirements(FALSE, (_rqs_), \
413 &(struct universal){.kind = VUT_TERRAIN, \
414 .value = {.terrain = (_ter_)}})
415#define requirement_fulfilled_by_unit_class(_uc_, _rqs_) \
416 universal_fulfills_requirements(FALSE, (_rqs_), \
417 &(struct universal){.kind = VUT_UCLASS, .value = {.uclass = (_uc_)}})
418#define requirement_fulfilled_by_unit_type(_ut_, _rqs_) \
419 universal_fulfills_requirements(FALSE, (_rqs_), \
420 &(struct universal){.kind = VUT_UTYPE, .value = {.utype = (_ut_)}})
421#define requirement_fulfilled_by_extra(_ex_, _rqs_) \
422 universal_fulfills_requirements(FALSE, (_rqs_), \
423 &(struct universal){.kind = VUT_EXTRA, .value = {.extra = (_ex_)}})
424#define requirement_fulfilled_by_output_type(_o_, _rqs_) \
425 universal_fulfills_requirements(FALSE, (_rqs_), \
426 &(struct universal){.kind = VUT_OTYPE, .value = {.outputtype = (_o_)}})
427#define requirement_fulfilled_by_action(_act_, _rqs_) \
428 universal_fulfills_requirements(FALSE, (_rqs_), \
429 &(struct universal){.kind = VUT_ACTION, .value = {.action = (_act_)}})
430
431#define requirement_needs_improvement(_imp_, _rqs_) \
432 universal_fulfills_requirements(TRUE, (_rqs_), \
433 &(struct universal){.kind = VUT_IMPROVEMENT, \
434 .value = {.building = (_imp_)}})
435
436int requirement_kind_ereq(const int value,
437 const enum req_range range,
438 const bool present,
439 const int max_value);
440
441#define requirement_diplrel_ereq(_id_, _range_, _present_) \
442 requirement_kind_ereq(_id_, _range_, _present_, DRO_LAST)
443
444#ifdef __cplusplus
445}
446#endif /* __cplusplus */
447
448#endif /* FC__REQUIREMENTS_H */
astring.h
reqs
struct @21::@22 reqs
fc_types.h
req_problem_type
req_problem_type
Definition fc_types.h:584
source
static GtkWidget * source
Definition gotodlg.c:58
type
GType type
Definition repodlgs.c:1312
bufsz
static const int bufsz
Definition helpdlg.c:70
map_types.h
universal_never_there
bool universal_never_there(const struct universal *source)
Definition requirements.c:4685
req_vec_problem_new
struct req_vec_problem * req_vec_problem_new(int num_suggested_solutions, const char *description,...)
Definition requirements.c:4969
universal_is_relevant_to_requirement
bool universal_is_relevant_to_requirement(const struct requirement *req, const struct universal *source)
Definition requirements.c:6008
is_req_in_vec
bool is_req_in_vec(const struct requirement *req, const struct requirement_vector *vec)
Definition requirements.c:4649
universal_build_shield_cost
int universal_build_shield_cost(const struct city *pcity, const struct universal *target)
Definition requirements.c:5819
req_vec_get_first_contradiction
struct req_vec_problem * req_vec_get_first_contradiction(const struct requirement_vector *vec, requirement_vector_number get_num, const void *parent_item)
Definition requirements.c:5014
req_context_empty
const struct req_context * req_context_empty(void)
Definition requirements.c:901
req_vec_num_in_item
signed char req_vec_num_in_item
req_vec_num_in_item a requirement vectors number in an item.
Definition requirements.h:229
universal_extraction
void universal_extraction(const struct universal *source, int *kind, int *value)
Definition requirements.c:780
requirement_vector_number
req_vec_num_in_item(* requirement_vector_number)(const void *parent_item, const struct requirement_vector *vec)
Definition requirements.h:240
req_to_fstring
const char * req_to_fstring(const struct requirement *req, struct astring *astr)
Definition requirements.c:916
requirement_vector_namer
const char *(* requirement_vector_namer)(req_vec_num_in_item number)
Definition requirements.h:262
req_vec_vector_number
req_vec_num_in_item req_vec_vector_number(const void *parent_item, const struct requirement_vector *vec)
Definition requirements.c:4789
req_vec_by_number
struct requirement_vector * req_vec_by_number(const void *parent_item, req_vec_num_in_item number)
Definition requirements.c:4808
universal_fulfills_requirements
bool universal_fulfills_requirements(bool check_necessary, const struct requirement_vector *reqs, const struct universal *source)
Definition requirements.c:5971
req_vec_change_apply
bool req_vec_change_apply(const struct req_vec_change *modification, requirement_vector_by_number getter, const void *parent_item)
Definition requirements.c:4897
universal_copy
void universal_copy(struct universal *dst, const struct universal *src)
Definition requirements.c:770
req_unchanging_cond_cb
enum req_unchanging_status(* req_unchanging_cond_cb)(const struct civ_map *nmap, enum req_unchanging_status def, const struct req_context *context, const struct requirement *req)
Definition requirements.h:128
are_requirements_equal
bool are_requirements_equal(const struct requirement *req1, const struct requirement *req2)
Definition requirements.c:1296
is_req_active
bool is_req_active(const struct req_context *context, const struct player *other_player, const struct requirement *req, const enum req_problem_type prob_type)
Definition requirements.c:4268
req_vec_change_translation
const char * req_vec_change_translation(const struct req_vec_change *change, const requirement_vector_namer namer)
Definition requirements.c:4824
req_from_str
struct requirement req_from_str(const char *type, const char *range, bool survives, bool present, bool quiet, const char *value)
Definition requirements.c:938
req_vec_suggest_repair
struct req_vec_problem * req_vec_suggest_repair(const struct requirement_vector *vec, requirement_vector_number get_num, const void *parent_item)
Definition requirements.c:5079
universal_value_from_str
void universal_value_from_str(struct universal *source, const char *value)
Definition requirements.c:276
req_tester_cb
enum fc_tristate(* req_tester_cb)(const struct req_context *context, const struct player *other_player, const struct requirement *req, void *data, int n_data)
Definition requirements.h:185
req_get_values
void req_get_values(const struct requirement *req, int *type, int *range, bool *survives, bool *present, bool *quiet, int *value)
Definition requirements.c:1268
req_from_values
struct requirement req_from_values(int type, int range, bool survives, bool present, bool quiet, int value)
Definition requirements.c:1249
are_reqs_active
bool are_reqs_active(const struct req_context *context, const struct player *other_player, const struct requirement_vector *reqs, const enum req_problem_type prob_type)
Definition requirements.c:4361
universal_rule_name
const char * universal_rule_name(const struct universal *psource)
Definition requirements.c:5392
universal_replace_in_req_vec
bool universal_replace_in_req_vec(struct requirement_vector *reqs, const struct universal *to_replace, const struct universal *replacement)
Definition requirements.c:5838
default_tester_cb
enum fc_tristate default_tester_cb(const struct req_context *context, const struct player *other_player, const struct requirement *req, void *data, int n_data)
Definition requirements.c:4496
are_requirements_contradictions
bool are_requirements_contradictions(const struct requirement *req1, const struct requirement *req2)
Definition requirements.c:1438
tri_req_active_turns
enum fc_tristate tri_req_active_turns(int pass, int period, const struct req_context *context, const struct player *other_player, const struct requirement *req)
Definition requirements.c:4381
universal_is_legal_in_requirement
bool universal_is_legal_in_requirement(const struct universal *univ)
Definition requirements.c:263
requirement_kind_ereq
int requirement_kind_ereq(const int value, const enum req_range range, const bool present, const int max_value)
Definition requirements.c:6388
req_vec_problem_free
void req_vec_problem_free(struct req_vec_problem *issue)
Definition requirements.c:4994
req_vec_get_first_missing_univ
struct req_vec_problem * req_vec_get_first_missing_univ(const struct requirement_vector *vec, requirement_vector_number get_num, const void *parent_item)
Definition requirements.c:5100
universal_by_number
struct universal universal_by_number(const enum universals_n kind, const int value)
Definition requirements.c:567
universal_fulfills_requirement
enum req_item_found universal_fulfills_requirement(const struct requirement *preq, const struct universal *source)
Definition requirements.c:5950
req_vec_wants_type
bool req_vec_wants_type(const struct requirement_vector *reqs, enum universals_n kind)
Definition requirements.c:4667
requirement_vector_by_number
struct requirement_vector *(* requirement_vector_by_number)(const void *parent_item, req_vec_num_in_item number)
Definition requirements.h:252
tri_reqs_cb_active
enum fc_tristate tri_reqs_cb_active(const struct req_context *context, const struct player *other_player, const struct requirement_vector *reqs, struct requirement_vector *maybe_reqs, req_tester_cb tester, void *data, int n_data)
Definition requirements.c:4524
req_vec_get_first_redundant_req
struct req_vec_problem * req_vec_get_first_redundant_req(const struct requirement_vector *vec, requirement_vector_number get_num, const void *parent_item)
Definition requirements.c:5185
does_req_contradicts_reqs
bool does_req_contradicts_reqs(const struct requirement *req, const struct requirement_vector *vec)
Definition requirements.c:1539
are_universals_equal
bool are_universals_equal(const struct universal *psource1, const struct universal *psource2)
Definition requirements.c:5278
req_vec_problem_new_transl
struct req_vec_problem * req_vec_problem_new_transl(int num_suggested_solutions, const char *description, const char *description_translated)
Definition requirements.c:4935
tri_req_active
enum fc_tristate tri_req_active(const struct req_context *context, const struct player *other_player, const struct requirement *req)
Definition requirements.c:4328
universals_say_everything
bool universals_say_everything(struct requirement_vector *reqs, struct universal *unis, size_t n_unis)
Definition requirements.c:5913
universal_type_rule_name
const char * universal_type_rule_name(const struct universal *psource)
Definition requirements.c:5811
universal_found_functions_init
void universal_found_functions_init(void)
Definition requirements.c:6359
universal_number
int universal_number(const struct universal *source)
Definition requirements.c:790
universal_is_mentioned_by_requirements
bool universal_is_mentioned_by_requirements(const struct requirement_vector *reqs, const struct universal *psource)
Definition requirements.c:5858
req_vec_is_impossible_to_fulfill
bool req_vec_is_impossible_to_fulfill(const struct requirement_vector *reqs)
Definition requirements.c:4769
req_implies_req
bool req_implies_req(const struct requirement *req1, const struct requirement *req2)
Definition requirements.c:1421
req_copy
void req_copy(struct requirement *dst, const struct requirement *src)
Definition requirements.c:1283
is_req_unchanging
enum req_unchanging_status is_req_unchanging(const struct req_context *context, const struct requirement *req)
Definition requirements.c:4571
is_req_preventing
enum req_unchanging_status is_req_preventing(const struct req_context *context, const struct player *other_player, const struct requirement *req, enum req_problem_type prob_type)
Definition requirements.c:4619
req_item_found
req_item_found
Definition requirements.h:370
ITF_NO
@ ITF_NO
Definition requirements.h:370
ITF_YES
@ ITF_YES
Definition requirements.h:370
ITF_NOT_APPLICABLE
@ ITF_NOT_APPLICABLE
Definition requirements.h:370
req_is_impossible_to_fulfill
bool req_is_impossible_to_fulfill(const struct requirement *req)
Definition requirements.c:4756
universal_name_translation
const char * universal_name_translation(const struct universal *psource, char *buf, size_t bufsz)
Definition requirements.c:5529
universal_by_rule_name
struct universal universal_by_rule_name(const char *kind, const char *value)
Definition requirements.c:231
req_unchanging_status
req_unchanging_status
Definition requirements.h:113
REQUCH_ACT
@ REQUCH_ACT
Definition requirements.h:117
REQUCH_NO
@ REQUCH_NO
Definition requirements.h:114
REQUCH_SCRIPTS
@ REQUCH_SCRIPTS
Definition requirements.h:119
REQUCH_YES
@ REQUCH_YES
Definition requirements.h:121
REQUCH_HACK
@ REQUCH_HACK
Definition requirements.h:120
REQUCH_CTRL
@ REQUCH_CTRL
Definition requirements.h:115
universals_mean_unfulfilled
bool universals_mean_unfulfilled(struct requirement_vector *reqs, struct universal *unis, size_t n_unis)
Definition requirements.c:5880
req_vec_suggest_improvement
struct req_vec_problem * req_vec_suggest_improvement(const struct requirement_vector *vec, requirement_vector_number get_num, const void *parent_item)
Definition requirements.c:5251
fc_tristate
fc_tristate
Definition shared.h:46
specenum_gen.h
specvec.h
action
Definition actions.h:379
astring
Definition astring.h:36
city
Definition city.h:309
civ_map
Definition map_types.h:71
impr_type
Definition improvement.h:68
output_type
Definition city.h:251
player
Definition player.h:249
range
Definition unittype.c:931
req_context
Definition requirements.h:99
req_context::building
const struct impr_type * building
Definition requirements.h:107
req_context::action
const struct action * action
Definition requirements.h:110
req_context::tile
const struct tile * tile
Definition requirements.h:102
req_context::player
const struct player * player
Definition requirements.h:100
req_context::output
const struct output_type * output
Definition requirements.h:108
req_context::unittype
const struct unit_type * unittype
Definition requirements.h:106
req_context::unit
const struct unit * unit
Definition requirements.h:105
req_context::city
const struct city * city
Definition requirements.h:101
req_context::specialist
const struct specialist * specialist
Definition requirements.h:109
req_vec_change
Definition requirements.h:280
req_vec_change::vector_number
req_vec_num_in_item vector_number
Definition requirements.h:284
req_vec_change::operation
enum req_vec_change_operation operation
Definition requirements.h:281
req_vec_change::req
struct requirement req
Definition requirements.h:282
req_vec_problem
Definition requirements.h:287
req_vec_problem::num_suggested_solutions
int num_suggested_solutions
Definition requirements.h:293
req_vec_problem::description
char description[500]
Definition requirements.h:290
req_vec_problem::description_translated
char description_translated[500]
Definition requirements.h:291
req_vec_problem::suggested_solutions
struct req_vec_change * suggested_solutions
Definition requirements.h:294
requirement
Definition requirements.h:80
requirement::quiet
bool quiet
Definition requirements.h:85
requirement::survives
bool survives
Definition requirements.h:83
requirement::present
bool present
Definition requirements.h:84
requirement::range
enum req_range range
Definition requirements.h:82
requirement::source
struct universal source
Definition requirements.h:81
specialist
Definition specialist.h:29
tile
Definition tile.h:49
unit_type
Definition unittype.h:481
unit
Definition unit.h:138
universal
Definition fc_types.h:756
universal::kind
enum universals_n kind
Definition fc_types.h:758
universal::value
universals_u value
Definition fc_types.h:757
bool
#define bool
Definition support.h:61