Freeciv21
Develop your civilization from humble roots to a global empire
diplhand.h
Go to the documentation of this file.
1 /**************************************************************************
2  Copyright (c) 1996-2020 Freeciv21 and Freeciv contributors. This file is
3  __ __ part of Freeciv21. Freeciv21 is free software: you can
4 / \\..// \ redistribute it and/or modify it under the terms of the GNU
5  ( oo ) General Public License as published by the Free Software
6  \__/ Foundation, either version 3 of the License, or (at your
7  option) any later version. You should have received
8  a copy of the GNU General Public License along with Freeciv21. If not,
9  see https://www.gnu.org/licenses/.
10 **************************************************************************/
11 #pragma once
12 
13 #include "fc_types.h"
14 
15 #include "hand_gen.h"
16 
17 struct Treaty;
18 struct packet_diplomacy_info;
19 struct connection;
20 
21 #define SPECLIST_TAG treaty
22 #define SPECLIST_TYPE struct Treaty
23 #include "speclist.h"
24 
25 // FIXME: Should this be put in a ruleset somewhere?
26 const int TURNS_LEFT = 16;
27 const int TURNS_EXTEND_CEASEFIRE = 1;
28 
29 #define treaty_list_iterate(list, p) \
30  TYPED_LIST_ITERATE(struct Treaty, list, p)
31 #define treaty_list_iterate_end LIST_ITERATE_END
32 
33 void establish_embassy(struct player *pplayer, struct player *aplayer);
34 
35 void diplhand_init();
36 void diplhand_free();
37 void free_treaties();
38 
39 struct Treaty *find_treaty(struct player *plr0, struct player *plr1);
40 
41 void send_diplomatic_meetings(struct connection *dest);
42 void cancel_all_meetings(struct player *pplayer);
43 void reject_all_treaties(struct player *pplayer);
44 
45 struct treaty_list *get_all_treaties();
void establish_embassy(struct player *pplayer, struct player *aplayer)
Create an embassy.
Definition: diplhand.cpp:689
void diplhand_init()
Initialize diplhand module.
Definition: diplhand.cpp:73
void send_diplomatic_meetings(struct connection *dest)
Send information on any on-going diplomatic meetings for connection's player.
Definition: diplhand.cpp:859
struct Treaty * find_treaty(struct player *plr0, struct player *plr1)
Find currently active treaty between two players.
Definition: diplhand.cpp:105
void free_treaties()
Free all the treaties currently in treaty list.
Definition: diplhand.cpp:89
const int TURNS_EXTEND_CEASEFIRE
Definition: diplhand.h:27
void diplhand_free()
Free all the resources allocated by diplhand.
Definition: diplhand.cpp:78
struct treaty_list * get_all_treaties()
Get treaty list.
Definition: diplhand.cpp:933
void reject_all_treaties(struct player *pplayer)
Reject all treaties currently being negotiated.
Definition: diplhand.cpp:911
void cancel_all_meetings(struct player *pplayer)
Cancels all meetings of player.
Definition: diplhand.cpp:897
const int TURNS_LEFT
Definition: diplhand.h:26
struct player * plr0
Definition: diptreaty.h:70
struct player * plr1
Definition: diptreaty.h:70
Definition: player.h:231