-
Notifications
You must be signed in to change notification settings - Fork 70
/
Copy pathtypes.h
34 lines (26 loc) · 812 Bytes
/
types.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
#ifndef _types_h
#define _types_h
#define UID_null 0
// Entity types (legend applies to level.h)
#define E_FLOOR 0x0 // . (also null)
#define E_WALL 0xF // #
#define E_PLAYER 0x1 // P
#define E_ENEMY 0x2 // E
#define E_DOOR 0x4 // D
#define E_LOCKEDDOOR 0x5 // L
#define E_EXIT 0x7 // X
// collectable entities >= 0x8
#define E_MEDIKIT 0x8 // M
#define E_KEY 0x9 // K
#define E_FIREBALL 0xA // not in map
typedef uint16_t UID;
typedef uint8_t EType;
struct Coords {
double x;
double y;
};
UID create_uid(EType type, uint8_t x, uint8_t y);
EType uid_get_type(UID uid);
Coords create_coords(double x, double y);
uint8_t coords_distance(Coords* a, Coords* b);
#endif