unfinished work on random map gen
This commit is contained in:
22
src/map.h
22
src/map.h
@ -14,12 +14,12 @@ private:
|
||||
static const int MIN_ROOM_WIDTH = 3;
|
||||
static const int MIN_ROOM_HEIGHT = 3;
|
||||
static const int MAX_ROOM_WIDTH = 20;
|
||||
static const int MAX_ROOM_HEIGHT = 13;
|
||||
static const int MAX_ROOM_HEIGHT = 5;
|
||||
// setup safezones
|
||||
static const int ACTUAL_MAP_WIDTH = MAP_WIDTH - 4;
|
||||
static const int ACTUAL_MAP_HEIGHT = MAP_HEIGHT - 4;
|
||||
static const int MAP_PADDING = 1;
|
||||
static const int MIN_ROOM_SPACING = 4;
|
||||
static const int MAP_PADDING = 2;
|
||||
static const int MIN_ROOM_SPACING = 3;
|
||||
static const int WIDTH_RESERVED = 8;
|
||||
static const int HEIGHT_RESERVED = 4;
|
||||
|
||||
@ -32,9 +32,9 @@ private:
|
||||
int room_cnt;
|
||||
public:
|
||||
// randomly generate a map
|
||||
game_map(RNG &rng, const feature enabled_features);
|
||||
game_map(RNG *rng, const feature enabled_features);
|
||||
// read map from a string
|
||||
game_map(const std::string &map_data, RNG &rng,
|
||||
game_map(const std::string &map_data, RNG *rng,
|
||||
const feature enabled_features);
|
||||
|
||||
const position_list get_available_positions() const;
|
||||
@ -60,12 +60,18 @@ private:
|
||||
|
||||
position random_size(int min_width, int min_height,
|
||||
int max_width, int max_height,
|
||||
RNG &rng);
|
||||
RNG *rng);
|
||||
|
||||
std::vector<std::pair<position, int>> gen_room_dims(RNG &rng);
|
||||
std::vector<std::pair<position, position>> distr_rooms(RNG &rng,
|
||||
std::vector<std::pair<position, int>> gen_room_dims(RNG *rng);
|
||||
std::vector<std::pair<position, position>> distr_rooms(RNG *rng,
|
||||
std::vector<std::pair<position, int>>
|
||||
&room_dims);
|
||||
|
||||
bool overlap_x(std::pair<position, position> &room1,
|
||||
std::pair<position, position> &room2);
|
||||
bool overlap_y(std::pair<position, position> &room1,
|
||||
std::pair<position, position> &room2);
|
||||
void jitter(RNG *rng, std::vector<std::pair<position, position>> &rooms);
|
||||
};
|
||||
|
||||
const std::string default_map =
|
||||
|
Reference in New Issue
Block a user