-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlocations.h
56 lines (45 loc) · 1018 Bytes
/
locations.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
#ifndef LOCATIONS_H
#define LOCATIONS_H
typedef enum
{
CITY,
FOREST,
SEA,
//etc...
}WorldLocations;
typedef enum
{
COMMERCIAL_ALLEY,
RESIDENTIAL_ALLEY,
//etc...
}CityLocations;
typedef enum
{
SHOP,
//etc...
};
typedef enum
{
ARENA,
SHOP,
DOJO,
COMMERCIAL_ALLEY,
//etc...
}CityLocations;
typedef struct _location
{
char *name; //use strdup()
char *description;
NamedNPC *namedNpcs;
CommonNPC *commonNpcs;
struct _location *parent;
struct _location *children[];//realloc se size change karenge.
}Location;
// Function to create a new location node
Location *createLocationNode(char *name,char *desc,NamedNPC *namedNpcs,CommonNPC *commonNpcs,Location *parent);
// Function to add a branch (child node) to a location node
void addBranch(Location *child,Location *parent);
// Function to navigate to a specific location node by name
Location* navigate(Location *current, char *name);
//Any other suitable function
#endif