summaryrefslogtreecommitdiff
path: root/src/modules/modBasic.c
blob: 8494916e729dcfc0d52d071cdf1db597d2727f2c (plain)
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>

#include "main.h"
#include "modules.h"
#include "tux.h"
#include "shot.h"
#include "list.h"
#include "gun.h"
#include "space.h"

#ifndef PUBLIC_SERVER
#include "interface.h"
#include "image.h"
#else /* PUBLIC_SERVER */
#include "publicServer.h"
#endif /* PUBLIC_SERVER */

static export_fce_t *export_fce;

static int init(export_fce_t *p)
{
	export_fce = p;

	debug("Initializing Basic module");
	return 0;
}

#ifndef PUBLIC_SERVER
static int draw(int x, int y, int w, int h)
{
	debug("Drawing Basic module");
	return 0;
}
#endif /* PUBLIC_SERVER */

static int event()
{
	debug("Basic module catch event");
	return 0;
}

static int isConflict(int x, int y, int w, int h)
{
	debug("isConflict(%d, %d, %d, %d) in Basic module", x, y, w, h);
	return 0;
}

static void cmd_basic(char *line)
{
	debug("cmd_basic(%s) in Basic module", line);
}

static void cmdArena(char *line)
{
	if (strncmp(line, "basic", 5) == 0) {
		cmd_basic(line);
	}
}

static void recvMsg(char *msg)
{
	debug("recvMsg(%s) in Basic module", msg);
}

static int destroy()
{
	debug("Destroying Basic module");
	return 0;
}

mod_sym_t modbasic_sym = { &init,
#ifndef PUBLIC_SERVER
			  &draw,
#else /* PUBLIC_SERVER */
			  0,
#endif /* PUBLIC_SERVER */
			  &event,
			  &isConflict,
			  &cmdArena,
			  &recvMsg,
			  &destroy };