-
Notifications
You must be signed in to change notification settings - Fork 0
/
data.h
146 lines (121 loc) · 3.5 KB
/
data.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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
#ifndef DATA_H_DEFINE
#define DATA_H_DEFINE
#ifdef _MSC_VER
#pragma once
#endif // _MSC_VER
#define DOOR_INVALID_FLAG -17
struct door{
int dest;
char *path;
};
struct ll_door{
struct door data;
struct ll_door *next;
};
struct doors{
struct ll_door *paths;
int numDoors;
};
struct action{
int actionType;
int itemTarget;
int quantity;
char *desc;
int roomTarget;
int doorTarget;
int destTarget;
};
struct item{
char *name;
char *desc;
struct action itemAction;
int pickable;
int id;
};
struct ll_item{
struct ll_item *next;
struct item data;
};
struct items{
struct ll_item *itemData;
int numItems;
int nextID;
};
struct room{
struct doors paths;
struct items inventory;
char *name;
char *desc;
int id;
};
struct ll_room{
struct ll_room *next;
struct room data;
};
struct rooms{
struct ll_room *roomData;
int numRooms;
int nextID;
};
struct combo{
int primaryID;
int secondaryID;
int resultID;
char *desc;
};
struct ll_combo{
struct combo data;
struct ll_combo *next;
};
struct combos{
struct ll_combo *data;
int numCombos;
};
struct world{
struct items inventory;
struct items itemPrototypes;
struct rooms worldRooms;
struct combos recipes;
char *introMessage;
char mode;
int currentRoomIndex;
int currentRoomId;
int playing;
};
struct ll_item * iAppend(struct ll_item *head, struct item data);
struct ll_item * iFindItemByIndex(struct ll_item *head, int index);
struct ll_item * iFindItemByID(struct ll_item *head, int id);
struct ll_item * iDeleteItemByIndex(struct ll_item *head, int index);
struct ll_item * iDeleteItemByID(struct ll_item *head, int id);
struct ll_item * iDeleteEnd(struct ll_item *head);
struct ll_item * iDeleteAll(struct ll_item *head);
struct ll_room * rAppend(struct ll_room *head, struct room data);
struct ll_room * rFindRoomByIndex(struct ll_room *head, int index);
struct ll_room * rFindRoomByID(struct ll_room *head, int id);
struct ll_room * rDeleteRoomByIndex(struct ll_room *head, int index);
struct ll_room * rDeleteRoomByID(struct ll_room *head, int id);
struct ll_room * rDeleteEnd(struct ll_room *head);
struct ll_room * rDeleteAll(struct ll_room *head);
struct ll_door * dAppend(struct ll_door *head, struct door data);
struct ll_door * dFindDoorByIndex(struct ll_door *head, int index);
struct ll_door * dDeleteDoorByIndex(struct ll_door *head, int index);
struct ll_door * dDeleteEnd(struct ll_door *head);
struct ll_door * dDeleteAll(struct ll_door *head);
struct ll_combo * cAppend(struct ll_combo *head, struct combo data);
struct ll_combo * cFindComboByIndex(struct ll_combo *head, int index);
struct ll_combo * cDeleteComboByIndex(struct ll_combo *head, int index);
struct ll_combo * cDeleteEnd(struct ll_combo *head);
struct ll_combo * cDeleteAll(struct ll_combo *head);
struct world initWorld(void);
struct room initRoom(int id);
struct room * getCurrentRoom(struct rooms worldRooms, int roomId);
struct combo * findCombo(struct combos recipes, int target1ID, int target2ID);
void printRoom(struct room currentRoom, struct items playerItems);
void printPaths(struct doors possibleDoors);
void printItems(struct items roomItems, struct items bagItems);
void printRoomVerbose(struct room currentRoom);
void printRoomsVerbose(struct rooms toPrint);
void printItemsVerbose(struct items roomItems);
void printPathsVerbose(struct doors toPrint);
void printCombosVerbose(struct combos toPrint);
#endif // DATA_H_DEFINE