Freeciv-3.3
Loading...
Searching...
No Matches
oblig_reqs.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__OBLIG_REQS_H
14#define FC__OBLIG_REQS_H
15
16#ifdef __cplusplus
17extern "C" {
18#endif /* __cplusplus */
19
20/* Custom data types for obligatory hard action requirements. */
21
22/* A contradiction to an obligatory hard requirement. */
24 /* A requirement that contradicts the obligatory hard requirement. */
26
27 /* Is the obligatory hard requirement in the action enabler's target
28 * requirement vector? If FALSE it is in its actor requirement vector. */
30};
31
32/* An obligatory hard action requirement */
34 /* The requirement is fulfilled if the action enabler doesn't contradict
35 * one of the contradictions listed here. */
37
38 /* The error message to show when the hard obligatory requirement is
39 * missing. Must be there. */
40 const char *error_msg;
41};
42
43#define SPECVEC_TAG obligatory_req
44#define SPECVEC_TYPE struct obligatory_req
45#include "specvec.h"
46#define obligatory_req_vector_iterate(obreq_vec, pobreq) \
47 TYPED_VECTOR_ITERATE(struct obligatory_req, obreq_vec, pobreq)
48#define obligatory_req_vector_iterate_end VECTOR_ITERATE_END
49
50/* One or more alternative obligatory hard requirement contradictions. */
53 /* The obligatory hard requirement is fulfilled if a contradiction exists
54 * that doesn't contradict the action enabler. */
56
57 /* How many obligatory reqs use this */
58 int users;
59};
60
61void oblig_hard_reqs_init(void);
62void oblig_hard_reqs_free(void);
63
66
69
70#ifdef __cplusplus
71}
72#endif /* __cplusplus */
73
74#endif /* OBLIG_REQS_H */
char * incite_cost
Definition comments.c:76
void oblig_hard_reqs_init(void)
Definition oblig_reqs.c:807
void oblig_hard_reqs_free(void)
Definition oblig_reqs.c:827
void hard_code_oblig_hard_reqs_ruleset(void)
Definition oblig_reqs.c:770
void hard_code_oblig_hard_reqs(void)
Definition oblig_reqs.c:250
struct obligatory_req_vector * oblig_hard_reqs_get(enum action_result res)
Definition oblig_reqs.c:852
struct obligatory_req_vector * oblig_hard_reqs_get_sub(enum action_sub_result res)
Definition oblig_reqs.c:863
struct requirement req
Definition oblig_reqs.h:25
struct action_enabler_contradiction * alternative
Definition oblig_reqs.h:55
struct ae_contra_or * contras
Definition oblig_reqs.h:36
const char * error_msg
Definition oblig_reqs.h:40