Freeciv-3.2
Loading...
Searching...
No Matches
clitreaty.c
Go to the documentation of this file.
1/***********************************************************************
2 Freeciv - Copyright (C) 2005 - The Freeciv Team
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#ifdef HAVE_CONFIG_H
15#include <fc_config.h>
16#endif
17
18/* utility */
19#include "shared.h"
20
21/* common */
22#include "diptreaty.h"
23
24/* client */
25#include "client_main.h"
26#include "diplodlg_g.h"
27
28#include "clitreaty.h"
29
30/**********************************************************************/
33void client_init_meeting(int counterpart, int initiated_from)
34{
35 struct Treaty *ptreaty;
36 struct player *we;
37 struct player *they;
38
40 return;
41 }
42
43 we = client_player();
44 they = player_by_number(counterpart);
46
47 if (ptreaty == NULL) {
48 ptreaty = fc_malloc(sizeof(*ptreaty));
51 }
52
54}
55
56/**********************************************************************/
59void client_recv_accept_treaty(int counterpart, bool I_accepted,
60 bool other_accepted)
61{
62 struct Treaty *ptreaty;
63 struct player *we;
64 struct player *they;
65
66 we = client_player();
67 they = player_by_number(counterpart);
69
70 if (ptreaty == NULL) {
71 return;
72 }
73
74 ptreaty->accept0 = I_accepted;
75 ptreaty->accept1 = other_accepted;
76
78}
79
80/**********************************************************************/
83void client_recv_cancel_meeting(int counterpart, int initiated_from)
84{
85 struct Treaty *ptreaty;
86 struct player *we;
87 struct player *they;
88
89 we = client_player();
90 they = player_by_number(counterpart);
92
93 if (ptreaty == NULL) {
94 return;
95 }
96
98
100}
101
102/**********************************************************************/
105void client_recv_create_clause(int counterpart, int giver,
106 enum clause_type type, int value)
107{
108 struct Treaty *ptreaty;
109 struct player *we;
110 struct player *they;
111
112 we = client_player();
113 they = player_by_number(counterpart);
115
116 if (ptreaty == NULL) {
117 return;
118 }
119
121
122 add_clause(ptreaty, player_by_number(giver), type, value,
123 client_player());
124
126}
127
128/**********************************************************************/
131void client_recv_remove_clause(int counterpart, int giver,
132 enum clause_type type, int value)
133{
134 struct Treaty *ptreaty;
135 struct player *we;
136 struct player *they;
137
138 we = client_player();
139 they = player_by_number(counterpart);
141
142 if (ptreaty == NULL) {
143 return;
144 }
145
147
149
151}
bool can_client_issue_orders(void)
#define client_player()
void client_recv_remove_clause(int counterpart, int giver, enum clause_type type, int value)
Definition clitreaty.c:131
void client_recv_create_clause(int counterpart, int giver, enum clause_type type, int value)
Definition clitreaty.c:105
void client_recv_accept_treaty(int counterpart, bool I_accepted, bool other_accepted)
Definition clitreaty.c:59
void client_recv_cancel_meeting(int counterpart, int initiated_from)
Definition clitreaty.c:83
void client_init_meeting(int counterpart, int initiated_from)
Definition clitreaty.c:33
char * incite_cost
Definition comments.c:75
struct Treaty struct player struct player *initiator gui_recv_create_clause
Definition diplodlg_g.h:32
struct Treaty * ptreaty
Definition diplodlg_g.h:28
struct Treaty struct player struct player *initiator struct Treaty struct player *they gui_recv_accept_treaty
Definition diplodlg_g.h:36
struct Treaty struct player * they
Definition diplodlg_g.h:28
gui_recv_cancel_meeting
Definition diplodlg_g.h:27
void init_treaty(struct Treaty *ptreaty, struct player *plr0, struct player *plr1)
Definition diptreaty.c:99
bool add_clause(struct Treaty *ptreaty, struct player *pfrom, enum clause_type type, int val, struct player *client_player)
Definition diptreaty.c:145
void treaty_add(struct Treaty *ptreaty)
Definition diptreaty.c:361
bool remove_clause(struct Treaty *ptreaty, struct player *pfrom, enum clause_type type, int val)
Definition diptreaty.c:123
void treaty_remove(struct Treaty *ptreaty)
Definition diptreaty.c:369
struct Treaty * find_treaty(struct player *plr0, struct player *plr1)
Definition diptreaty.c:346
void gui_init_meeting(struct Treaty *ptreaty, struct player *they, struct player *initiator)
Definition diplodlg.c:137
void gui_recv_remove_clause(struct Treaty *ptreaty, struct player *they)
Definition diplodlg.c:188
void gui_prepare_clause_updt(struct Treaty *ptreaty, struct player *they)
Definition diplodlg.c:163
GType type
Definition repodlgs.c:1313
#define fc_malloc(sz)
Definition mem.h:34
struct player * player_by_number(const int player_id)
Definition player.c:849
bool accept0
Definition diptreaty.h:80
bool accept1
Definition diptreaty.h:80