--- deliantra/server/random_maps/random_map.h 2010/03/26 01:04:44 1.23 +++ deliantra/server/random_maps/random_map.h 2010/06/26 22:10:18 1.26 @@ -27,11 +27,9 @@ #include "util.h" -struct random_map_params +struct random_map_params : zero_initialised { - char wallstyle[512]; char wall_name[512]; - char floorstyle[512]; char monsterstyle[512]; char treasurestyle[512]; char layoutstyle[512]; @@ -39,11 +37,9 @@ char decorstyle[512]; shstr origin_map; shstr final_map; - char exitstyle[512]; shstr this_map; char exit_on_final_map[512]; - char *custom; - + int xsize, ysize; int expand2x; int layoutoptions1; @@ -69,9 +65,20 @@ struct region *region; + HV *hv; + + // fetch something from the options hash + const_utf8_string get_str (const_utf8_string option, const_utf8_string fallback = "") const; + IV get_iv (const_utf8_string option, IV fallback = 0) const; + + void set (const_utf8_string option, const_utf8_string value); + void set (const_utf8_string option, IV value); + // "private", adjusted sizes int Xsize; int Ysize; + + ~random_map_params (); }; enum { @@ -196,5 +203,15 @@ } }; +// utility functions, to use rmg_rndm instead of rndm. +static inline int +rmg_find_free_spot (const object *ob, maptile *m, int x, int y, int start, int stop) +{ + swap (rmg_rndm, rndm); + int i = find_free_spot (ob, m, x, y, start, stop); + swap (rmg_rndm, rndm); + return i; +} + #endif