… | |
… | |
27 | */ |
27 | */ |
28 | |
28 | |
29 | #ifndef REGION_H |
29 | #ifndef REGION_H |
30 | #define REGION_H |
30 | #define REGION_H |
31 | |
31 | |
|
|
32 | typedef refptr<region> region_ptr; |
|
|
33 | |
32 | /* |
34 | /* |
33 | * Each map is in a given region of the game world and links to a region definition, so |
35 | * Each map is in a given region of the game world and links to a region definition, so |
34 | * they have to appear here in the headers, before the mapdef |
36 | * they have to appear here in the headers, before the mapdef |
35 | */ |
37 | */ |
36 | INTERFACE_CLASS (region) |
38 | INTERFACE_CLASS (region) |
37 | struct region : zero_initialised, attachable |
39 | struct region : zero_initialised, attachable |
38 | { |
40 | { |
39 | shstr ACC (RW, name); /* Shortend name of the region as maps refer to it */ |
41 | shstr ACC (RW, name); /* Shortend name of the region as maps refer to it */ |
40 | region *ACC (RW, parent); /* |
42 | region_ptr ACC (RW, parent); /* |
41 | * Pointer to the region that is a parent of the current |
43 | * Pointer to the region that is a parent of the current |
42 | * region, if a value isn't defined in the current region |
44 | * region, if a value isn't defined in the current region |
43 | * we traverse this series of pointers until it is. |
45 | * we traverse this series of pointers until it is. |
44 | */ |
46 | */ |
45 | shstr ACC (RW, longname); /* Official title of the region, this might be defined |
47 | shstr ACC (RW, longname); /* Official title of the region, this might be defined |
… | |
… | |
58 | |
60 | |
59 | static region *default_region (); |
61 | static region *default_region (); |
60 | static region *find (const char *name); |
62 | static region *find (const char *name); |
61 | static region *find_fuzzy (const char *name); |
63 | static region *find_fuzzy (const char *name); |
62 | static region *read (object_thawer &f); |
64 | static region *read (object_thawer &f); |
|
|
65 | |
|
|
66 | void do_destroy (); |
63 | }; |
67 | }; |
64 | |
68 | |
65 | typedef object_vector<region, ®ion::index> regionvec; |
69 | typedef object_vector<region, ®ion::index> regionvec; |
66 | |
70 | |
67 | extern regionvec regions; |
71 | extern regionvec regions; |