ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/random_maps/random_map.h
(Generate patch)

Comparing deliantra/server/random_maps/random_map.h (file contents):
Revision 1.23 by root, Fri Mar 26 01:04:44 2010 UTC vs.
Revision 1.27 by root, Sat Jun 26 23:53:31 2010 UTC

25#ifndef RANDOM_MAP_H 25#ifndef RANDOM_MAP_H
26#define RANDOM_MAP_H 26#define RANDOM_MAP_H
27 27
28#include "util.h" 28#include "util.h"
29 29
30struct random_map_params 30struct random_map_params : zero_initialised
31{ 31{
32 char wallstyle[512];
33 char wall_name[512]; 32 char wall_name[512];
34 char floorstyle[512];
35 char monsterstyle[512]; 33 char monsterstyle[512];
36 char treasurestyle[512]; 34 char treasurestyle[512];
37 char layoutstyle[512]; 35 char layoutstyle[512];
38 char doorstyle[512]; 36 char doorstyle[512];
39 char decorstyle[512]; 37 char decorstyle[512];
40 shstr origin_map; 38 shstr origin_map;
41 shstr final_map; 39 shstr final_map;
42 char exitstyle[512];
43 shstr this_map; 40 shstr this_map;
44 char exit_on_final_map[512]; 41 char exit_on_final_map[512];
45 char *custom; 42
46
47 int xsize, ysize; 43 int xsize, ysize;
48 int expand2x; 44 int expand2x;
49 int layoutoptions1; 45 int layoutoptions1;
50 int layoutoptions2; 46 int layoutoptions2;
51 int layoutoptions3; 47 int layoutoptions3;
67 int treasureoptions; 63 int treasureoptions;
68 int symmetry_used; 64 int symmetry_used;
69 65
70 struct region *region; 66 struct region *region;
71 67
68 HV *hv;
69
70 // fetch something from the options hash
71 const_utf8_string get_str (const_utf8_string option, const_utf8_string fallback = "") const;
72 IV get_iv (const_utf8_string option, IV fallback = 0) const;
73
74 void set (const_utf8_string option, const_utf8_string value);
75 void set (const_utf8_string option, IV value);
76
72 // "private", adjusted sizes 77 // "private", adjusted sizes
73 int Xsize; 78 int Xsize;
74 int Ysize; 79 int Ysize;
80
81 ~random_map_params ();
75}; 82};
76 83
77enum { 84enum {
78 LAYOUT_NONE, 85 LAYOUT_NONE,
79 LAYOUT_ONION, 86 LAYOUT_ONION,
192 { 199 {
193 ::swap (layout.ptr->col, ptr->col); 200 ::swap (layout.ptr->col, ptr->col);
194 ::swap (layout.ptr->w , ptr->w ); 201 ::swap (layout.ptr->w , ptr->w );
195 ::swap (layout.ptr->h , ptr->h ); 202 ::swap (layout.ptr->h , ptr->h );
196 } 203 }
204
205 // for debugging, print layout to stdout
206 void print ();
197}; 207};
208
209// utility functions, to use rmg_rndm instead of rndm.
210static inline int
211rmg_find_free_spot (const object *ob, maptile *m, int x, int y, int start, int stop)
212{
213 swap (rmg_rndm, rndm);
214 int i = find_free_spot (ob, m, x, y, start, stop);
215 swap (rmg_rndm, rndm);
216 return i;
217}
198 218
199#endif 219#endif
200 220

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines