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)
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__DIPTREATY_H
14 #define FC__DIPTREATY_H
18 #endif /* __cplusplus */
20 #include "support.h" /* bool type */
22 /* Used in the network protocol. */
23 enum clause_type
{ CLAUSE_ADVANCE
, CLAUSE_GOLD
, CLAUSE_MAP
,
24 CLAUSE_SEAMAP
, CLAUSE_CITY
,
25 CLAUSE_CEASEFIRE
, CLAUSE_PEACE
, CLAUSE_ALLIANCE
,
26 CLAUSE_VISION
, CLAUSE_EMBASSY
, CLAUSE_LAST
};
28 #define is_pact_clause(x) \
29 ((x == CLAUSE_CEASEFIRE) || (x == CLAUSE_PEACE) || (x == CLAUSE_ALLIANCE))
31 /* For when we need to iterate over treaties */
33 #define SPECLIST_TAG clause
34 #define SPECLIST_TYPE struct Clause
37 #define clause_list_iterate(clauselist, pclause) \
38 TYPED_LIST_ITERATE(struct Clause, clauselist, pclause)
39 #define clause_list_iterate_end LIST_ITERATE_END
42 enum clause_type type
;
48 struct player
*plr0
, *plr1
;
49 bool accept0
, accept1
;
50 struct clause_list
*clauses
;
53 bool diplomacy_possible(const struct player
*pplayer
,
54 const struct player
*aplayer
);
55 bool could_meet_with_player(const struct player
*pplayer
,
56 const struct player
*aplayer
);
57 bool could_intel_with_player(const struct player
*pplayer
,
58 const struct player
*aplayer
);
60 void init_treaty(struct Treaty
*ptreaty
,
61 struct player
*plr0
, struct player
*plr1
);
62 bool add_clause(struct Treaty
*ptreaty
, struct player
*pfrom
,
63 enum clause_type type
, int val
);
64 bool remove_clause(struct Treaty
*ptreaty
, struct player
*pfrom
,
65 enum clause_type type
, int val
);
66 void clear_treaty(struct Treaty
*ptreaty
);
70 #endif /* __cplusplus */
72 #endif /* FC__DIPTREATY_H */