… | |
… | |
48 | uint32_t random_seed; |
48 | uint32_t random_seed; |
49 | uint64_t total_map_hp; |
49 | uint64_t total_map_hp; |
50 | int map_layout_style; |
50 | int map_layout_style; |
51 | int symmetry_used; |
51 | int symmetry_used; |
52 | |
52 | |
53 | struct region *region; |
|
|
54 | |
|
|
55 | HV *hv; |
53 | HV *hv; |
56 | void hv_clone (); // replaces the hv by a clone'd copy (%new_hv = { %hv }) |
54 | void hv_clone (); // replaces the hv by a clone'd copy (%new_hv = { %hv }) |
57 | |
55 | |
58 | shstr_tmp as_shstr () const; |
56 | shstr_tmp as_shstr () const; |
59 | |
57 | |
… | |
… | |
74 | |
72 | |
75 | // "private", adjusted sizes |
73 | // "private", adjusted sizes |
76 | int Xsize; |
74 | int Xsize; |
77 | int Ysize; |
75 | int Ysize; |
78 | |
76 | |
|
|
77 | random_map_params (); |
|
|
78 | random_map_params (HV *hv); |
79 | ~random_map_params (); |
79 | ~random_map_params (); |
80 | }; |
80 | }; |
81 | |
81 | |
82 | enum { |
82 | enum { |
83 | LAYOUT_NONE, |
83 | LAYOUT_NONE, |
… | |
… | |
156 | cell **data; |
156 | cell **data; |
157 | int w, h; |
157 | int w, h; |
158 | |
158 | |
159 | layout (int w, int h); |
159 | layout (int w, int h); |
160 | layout (layout ©); |
160 | layout (layout ©); |
|
|
161 | layout (layout &orig, int x1, int y1, int x2, int y2); // reference rect in other layout |
161 | ~layout (); |
162 | ~layout (); |
162 | |
163 | |
163 | operator cell **() const |
164 | operator cell **() const |
164 | { |
165 | { |
165 | return data; |
166 | return data; |
166 | } |
167 | } |
167 | |
168 | |
168 | void swap (layout &maze) |
169 | void swap (layout &maze) |
169 | { |
170 | { |
170 | ::swap (maze.data, data); |
171 | ::swap (maze.data, data); |
171 | ::swap (maze.w , w ); |
172 | ::swap (maze.w , w ); |
172 | ::swap (maze.h , h ); |
173 | ::swap (maze.h , h ); |
|
|
174 | ::swap (maze.size, size); |
173 | } |
175 | } |
174 | |
176 | |
175 | MTH void swap (layout *maze) { swap (*maze); } |
177 | MTH void swap (layout *maze) { swap (*maze); } |
176 | |
178 | |
177 | // for debugging, print maze to stdout |
179 | // for debugging, print maze to stdout |
… | |
… | |
200 | MTH void symmetrize (int symmetry); |
202 | MTH void symmetrize (int symmetry); |
201 | MTH void rotate (int rotation); // rotate by 1=90, 2=180, 3=270 degrees |
203 | MTH void rotate (int rotation); // rotate by 1=90, 2=180, 3=270 degrees |
202 | |
204 | |
203 | void generate (random_map_params *RP); |
205 | void generate (random_map_params *RP); |
204 | private: |
206 | private: |
|
|
207 | int size; |
205 | void alloc (int w, int h); |
208 | void alloc (int w, int h); |
206 | }; |
209 | }; |
207 | |
210 | |
208 | // utility functions, to use rmg_rndm instead of rndm. |
211 | // utility functions, to use rmg_rndm instead of rndm. |
209 | static inline int |
212 | static inline int |