-
Notifications
You must be signed in to change notification settings - Fork 0
/
diplomacy.h
65 lines (42 loc) · 1.5 KB
/
diplomacy.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#ifndef DIPLOMACY_H
#define DIPLOMACY_H
#include "character.h"
#include "piece.h"
#include "map.h"
enum dipstatuslist {NEUTRAL, ALLIANCE, WAR, NR_DIPSTATUSES};
#define REJECT 0
#define ACCEPT 1
char *const dipofferlist[2]; /* peace offer and alliance offer */
extern char *const dipstatus_name[];
typedef struct dipoffer {
character_t *from;
character_t *to;
unsigned char offer;
} dipoffer_t;
typedef struct dipstatus {
character_t *character1;
character_t *character2;
unsigned char status;
dipoffer_t *pending_offer;
struct dipstatus *prev;
struct dipstatus *next;
} dipstatus_t;
dipstatus_t *set_diplomacy(character_t * name1, character_t * name2,
const unsigned int status);
dipstatus_t *get_dipstatus(character_t * name1, character_t * name2);
unsigned char get_diplomacy(character_t * name1, character_t * name2);
void remove_diplomacy(dipstatus_t * dipstatus);
void clear_diplomacy_list();
void remove_redundant_diplomacy();
void homage(character_t * character, character_t * lord);
void unhomage(character_t *character);
void promote_soldier(character_t * character, piece_t * piece, region_t * region,
char *name);
void promote_vassal(character_t * lord, character_t * vassal);
uint16_t count_vassals(character_t * character);
character_t *get_sovereign(character_t * character);
dipoffer_t *open_offer(character_t * from, character_t * to,
const unsigned int offer);
void close_offer(dipoffer_t * offer, const unsigned int result);
void sort_diplomacy_list();
#endif