… | |
… | |
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 definiton, 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 |
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 | shstr ACC (RW, match); // a perl regex that matches map paths |
|
|
41 | region *ACC (RW, parent); /* |
42 | region_ptr ACC (RW, parent); /* |
42 | * Pointer to the region that is a parent of the current |
43 | * Pointer to the region that is a parent of the current |
43 | * region, if a value isn't defined in the current region |
44 | * region, if a value isn't defined in the current region |
44 | * we traverse this series of pointers until it is. |
45 | * we traverse this series of pointers until it is. |
45 | */ |
46 | */ |
46 | 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 |
… | |
… | |
49 | shstr ACC (RW, jailmap); /*where a player that is arrested in this region should be imprisoned. */ |
50 | shstr ACC (RW, jailmap); /*where a player that is arrested in this region should be imprisoned. */ |
50 | sint16 ACC (RW, jailx), ACC (RW, jaily);/* The coodinates in jailmap to which the player should be sent. */ |
51 | sint16 ACC (RW, jailx), ACC (RW, jaily);/* The coodinates in jailmap to which the player should be sent. */ |
51 | shstr ACC (RW, portalmap); |
52 | shstr ACC (RW, portalmap); |
52 | sint16 ACC (RW, portalx), ACC (RW, portaly); |
53 | sint16 ACC (RW, portalx), ACC (RW, portaly); |
53 | object_vector_index ACC (RW, index); |
54 | object_vector_index ACC (RW, index); |
54 | uint32 ACC (RW, counter); /* A generic counter for holding temporary data. */ |
|
|
55 | bool ACC (RW, fallback); /* whether, in the event of a region not existing, |
55 | bool ACC (RW, fallback); /* whether, in the event of a region not existing, |
56 | * this should be the one we fall back on as the default */ |
56 | * this should be the one we fall back on as the default */ |
57 | float treasure_density; // chance of treasure per mapspace |
57 | float treasure_density; // chance of treasure per mapspace |
58 | treasurelist *treasure; // treasure to generate (mostly monsters) |
58 | treasurelist *treasure; // treasure to generate (mostly monsters) |
59 | |
59 | |
60 | static region *default_region (); |
60 | static region *default_region (); |
61 | static region *find (const char *name); |
61 | static region *find (const char *name); |
62 | static region *find_fuzzy (const char *name); |
62 | static region *find_fuzzy (const char *name); |
63 | static region *read (object_thawer &f); |
63 | static region *read (object_thawer &f); |
|
|
64 | |
|
|
65 | void do_destroy (); |
64 | }; |
66 | }; |
65 | |
67 | |
66 | typedef object_vector<region, ®ion::index> regionvec; |
68 | typedef object_vector<region, ®ion::index> regionvec; |
67 | |
69 | |
68 | extern regionvec regions; |
70 | extern regionvec regions; |