-
Notifications
You must be signed in to change notification settings - Fork 0
/
cestypes.h
61 lines (47 loc) · 999 Bytes
/
cestypes.h
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
// cestypes.h
#define NLINES 22
#define NCOLS 68
#define TIME_DELTA 100000
typedef struct
{
int key_active;
char key;
int mouse_active;
int x;
int y;
} UserInput;
typedef struct
{
int x;
int y;
} ComponentLocation;
typedef struct
{
char state;
} ComponentAppearance;
typedef struct
{
int hp;
} ComponentHealth;
typedef enum
{
COMPONENT_NONE = 0,
COMPONENT_PLAYER = 1 << 0,
COMPONENT_ENEMY = 1 << 1,
COMPONENT_LOCATION = 1 << 2,
COMPONENT_APPEARANCE = 1 << 3,
COMPONENT_HEALTH = 1 << 4,
COMPONENT_SCRIPT = 1 << 5,
COMPONENT_BOMB = 1 << 6,
} Component;
#define MAX_ENTITIES 20
typedef struct
{
int mask[ MAX_ENTITIES ];
ComponentLocation location[ MAX_ENTITIES ];
ComponentAppearance appearance[ MAX_ENTITIES ];
ComponentHealth health[ MAX_ENTITIES ];
} World;
extern World world;
void initEntities( World *world );
void destroyEntity( World *world, unsigned int entity );