2010-08-08 10:06:34 +02:00
|
|
|
/*
|
2015-01-30 22:10:29 +01:00
|
|
|
Copyright (c) 1998-2015, Enno Rehling <enno@eressea.de>
|
2015-01-30 20:37:14 +01:00
|
|
|
Katja Zedel <katze@felidae.kn-bremen.de
|
|
|
|
Christian Schlittchen <corwin@amber.kn-bremen.de>
|
2010-08-08 10:06:34 +02:00
|
|
|
|
|
|
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
|
|
purpose with or without fee is hereby granted, provided that the above
|
|
|
|
copyright notice and this permission notice appear in all copies.
|
|
|
|
|
|
|
|
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
|
|
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
|
|
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
|
|
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
|
|
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
|
|
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
|
|
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
|
|
**/
|
|
|
|
|
|
|
|
#ifndef H_KRNL_ALLIANCE
|
|
|
|
#define H_KRNL_ALLIANCE
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2015-01-30 20:37:14 +01:00
|
|
|
struct plane;
|
|
|
|
struct attrib;
|
|
|
|
struct unit;
|
|
|
|
struct faction;
|
|
|
|
struct region;
|
2010-08-08 10:06:34 +02:00
|
|
|
|
2015-01-30 20:37:14 +01:00
|
|
|
enum {
|
|
|
|
ALLIANCE_KICK,
|
|
|
|
ALLIANCE_LEAVE,
|
|
|
|
ALLIANCE_TRANSFER,
|
|
|
|
ALLIANCE_NEW,
|
|
|
|
ALLIANCE_INVITE,
|
|
|
|
ALLIANCE_JOIN,
|
|
|
|
ALLIANCE_MAX
|
|
|
|
};
|
2010-08-08 10:06:34 +02:00
|
|
|
|
2016-04-08 19:45:27 +02:00
|
|
|
extern const char* alliance_kwd[ALLIANCE_MAX];
|
2011-03-07 08:02:35 +01:00
|
|
|
#define ALF_NON_ALLIED (1<<0) /* this alliance is just a default for a non-allied faction */
|
2010-08-08 10:06:34 +02:00
|
|
|
|
2012-06-27 05:29:32 +02:00
|
|
|
#define ALLY_ENEMY (1<<0)
|
|
|
|
|
2015-01-30 20:37:14 +01:00
|
|
|
typedef struct alliance {
|
|
|
|
struct alliance *next;
|
|
|
|
struct faction *_leader;
|
|
|
|
struct quicklist *members;
|
|
|
|
int flags;
|
|
|
|
int id;
|
|
|
|
char *name;
|
|
|
|
struct ally *allies;
|
|
|
|
} alliance;
|
2010-08-08 10:06:34 +02:00
|
|
|
|
2015-01-30 20:37:14 +01:00
|
|
|
extern alliance *alliances;
|
2016-08-17 21:22:50 +02:00
|
|
|
alliance *findalliance(int id);
|
|
|
|
alliance *new_alliance(int id, const char *name);
|
|
|
|
alliance *makealliance(int id, const char *name);
|
|
|
|
const char *alliancename(const struct alliance *al);
|
|
|
|
void setalliance(struct faction *f, alliance * al);
|
2015-01-30 20:37:14 +01:00
|
|
|
void free_alliances(void);
|
2016-08-17 21:22:50 +02:00
|
|
|
struct faction *alliance_get_leader(struct alliance *al);
|
|
|
|
void alliance_cmd(void);
|
2015-01-30 20:37:14 +01:00
|
|
|
bool is_allied(const struct faction *f1, const struct faction *f2);
|
2010-08-08 10:06:34 +02:00
|
|
|
|
2015-01-30 20:37:14 +01:00
|
|
|
void alliance_setname(alliance * self, const char *name);
|
|
|
|
/* execute commands */
|
2010-08-08 10:06:34 +02:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
#endif
|