server/src/kernel/alliance.h
2011-03-07 08:02:35 +01:00

67 lines
2 KiB
C

/*
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
struct plane;
struct attrib;
struct unit;
struct faction;
struct region;
enum {
ALLIANCE_KICK,
ALLIANCE_LEAVE,
ALLIANCE_TRANSFER,
ALLIANCE_NEW,
ALLIANCE_INVITE,
ALLIANCE_JOIN,
ALLIANCE_MAX
};
#define ALF_NON_ALLIED (1<<0) /* this alliance is just a default for a non-allied faction */
typedef struct alliance {
struct alliance *next;
struct faction *_leader;
struct quicklist *members;
unsigned int flags;
int id;
char *name;
} alliance;
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);
void alliance_setname(alliance * self, const char *name);
/* execute commands */
#ifdef __cplusplus
}
#endif
#endif