-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtypes.h
63 lines (55 loc) · 821 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
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
#define BUF 128
#define LEN 32
#define MAX_HEALTH 100
#define MAX_HUNGER 100
#define MAX_THIRST 100
typedef unsigned char uchar;
enum {
DOOR,
APPLE,
KNIFE,
CRISPS,
SANDWICH,
COFFEE,
WATER,
QUILL_PEN,
METAL_PIPE,
BANDAGE,
WATER_COOLER,
PIZZA,
FORK,
ZOMBIE,
COMPUTER
};
typedef struct List {
struct List *next, *prev;
char *name;
} List;
typedef struct {
List hdr;
int type;
int data;
} Item;
typedef struct {
List hdr;
List *items;
List *plrs;
pthread_mutex_t lock;
} Room;
typedef struct {
List hdr;
List *items;
Room *room;
Item *hand;
int health, hunger, thirst;
FILE *in, *out;
pthread_mutex_t lock;
pthread_t th;
} Player;
typedef struct {
char *name;
void (*use)(Player*, Item*);
uchar take:1;
uchar attack:1;
uchar active:1;
} Prop;