Freeciv-3.3: /fast/freeciv/nightly/main/common/requirements.h Source File

Freeciv-3.3

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