server/src/common/modules/xmas.c

76 lines
1.5 KiB
C
Raw Normal View History

2001-12-30 09:29:04 +01:00
/* vi: set ts=2:
+-------------------+ Christian Schlittchen <corwin@amber.kn-bremen.de>
| | Enno Rehling <enno@eressea-pbem.de>
| Eressea PBEM host | Katja Zedel <katze@felidae.kn-bremen.de>
| (c) 1998 - 2003 | Henning Peters <faroul@beyond.kn-bremen.de>
2001-12-30 09:29:04 +01:00
| | Ingo Wilken <Ingo.Wilken@informatik.uni-oldenburg.de>
+-------------------+ Stefan Reich <reich@halbling.de>
This program may not be used, modified or distributed
without prior permission by the authors of Eressea.
*/
#include <config.h>
#include <eressea.h>
#include "xmas.h"
/* kernel includes */
2007-08-05 14:26:46 +02:00
#include <kernel/building.h>
#include <kernel/faction.h>
#include <kernel/item.h>
#include <kernel/move.h>
#include <kernel/race.h>
#include <kernel/region.h>
#include <kernel/unit.h>
2001-12-30 09:29:04 +01:00
/* util includes */
2007-08-05 14:26:46 +02:00
#include <util/base36.h>
#include <util/event.h>
#include <util/goodies.h>
2001-12-30 09:29:04 +01:00
2003-08-03 19:56:17 +02:00
/* libc includes */
#include <stdlib.h>
static int
xmasgate_handle(trigger * t, void * data)
{
return -1;
2003-08-03 19:56:17 +02:00
}
static void
xmasgate_write(const trigger * t, FILE * F)
{
building *b = (building *)t->data.v;
fprintf(F, "%s ", itoa36(b->no));
}
static int
xmasgate_read(trigger * t, FILE * F)
{
return read_building_reference((building**)&t->data.v, F);
}
struct trigger_type tt_xmasgate = {
"xmasgate",
NULL,
NULL,
xmasgate_handle,
xmasgate_write,
xmasgate_read
};
trigger *
trigger_xmasgate(building * b)
{
trigger * t = t_new(&tt_xmasgate);
t->data.v = b;
return t;
}
void
init_xmas(void)
{
tt_register(&tt_xmasgate);
}