2010-08-08 10:06:34 +02:00
|
|
|
/*
|
|
|
|
Copyright (c) 1998-2010, Enno Rehling <enno@eressea.de>
|
|
|
|
Katja Zedel <katze@felidae.kn-bremen.de
|
|
|
|
Christian Schlittchen <corwin@amber.kn-bremen.de>
|
|
|
|
|
|
|
|
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
|
|
|
|
|
2011-03-07 08:02:35 +01:00
|
|
|
struct plane;
|
|
|
|
struct attrib;
|
|
|
|
struct unit;
|
|
|
|
struct faction;
|
|
|
|
struct region;
|
2010-08-08 10:06:34 +02:00
|
|
|
|
2011-03-07 08:02:35 +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
|
|
|
|
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
|
|
|
|
2011-03-07 08:02:35 +01:00
|
|
|
typedef struct alliance {
|
|
|
|
struct alliance *next;
|
|
|
|
struct faction *_leader;
|
|
|
|
struct quicklist *members;
|
|
|
|
unsigned int flags;
|
|
|
|
int id;
|
|
|
|
char *name;
|
|
|
|
} alliance;
|
2010-08-08 10:06:34 +02:00
|
|
|
|
2011-03-07 08:02:35 +01:00
|
|
|
extern alliance *alliances;
|
|
|
|
extern alliance *findalliance(int id);
|
|
|
|
extern alliance *makealliance(int id, const char *name);
|
|
|
|
extern const char *alliancename(const struct alliance *al);
|
|
|
|
extern void setalliance(struct faction *f, alliance * al);
|
|
|
|
void free_alliance(struct alliance *al);
|
|
|
|
extern struct faction *alliance_get_leader(struct alliance *al);
|
|
|
|
extern void alliance_cmd(void);
|
2010-08-08 10:06:34 +02:00
|
|
|
|
2011-03-07 08:02:35 +01:00
|
|
|
void alliance_setname(alliance * self, const char *name);
|
2010-08-08 10:06:34 +02:00
|
|
|
/* execute commands */
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
#endif
|