Map is now cleaned out of anything not directly related to the map, and there's a new WorldBuilder class that will turn into a more sophisticated random world generator.

This commit is contained in:
Zed A. Shaw 2024-12-02 06:32:00 -05:00
parent 3f7a9cc124
commit 68d8bdce12
8 changed files with 296 additions and 266 deletions

12
map.hpp
View file

@ -56,23 +56,15 @@ public:
Room &room(size_t at) { return $rooms[at]; }
size_t room_count() { return $rooms.size(); }
void partition_map(Room &cur, int depth);
void make_room(size_t origin_y, size_t origin_x, size_t width, size_t height);
void add_door(Room &room);
bool can_move(Point move_to);
void generate();
void set_door(Room &room, int value);
void place_rooms(Room &root);
Point place_entity(size_t room_index);
bool neighbors(Point &out, bool up);
bool inmap(size_t x, size_t y);
bool iswall(size_t x, size_t y);
bool can_move(Point move_to);
bool neighbors(Point &out, bool up);
void make_paths();
void set_target(const Point &at, int value=0);
void clear_target(const Point &at);
bool walk(Point &src, Point &target);
Point map_to_camera(const Point &loc, const Point &cam_orig);
Point center_camera(const Point &around, size_t view_x, size_t view_y);