Refactored the maze functions to be a builder that can do different things to the maze. Also when I hit p in the game it'll save the map to a file. This was extremely hard for no reason.

This commit is contained in:
Zed A. Shaw 2025-05-21 13:56:53 -04:00
parent 20f03731e5
commit 5f1a453fb4
8 changed files with 270 additions and 254 deletions

View file

@ -45,12 +45,11 @@ void Map::clear_target(const Point &at) {
}
bool Map::place_entity(size_t room_index, Point &out) {
dbc::check($dead_ends.size() != 0, "no dead ends?!");
if($rooms.size() == 0) {
dbc::log("fucking dead end?");
out = $dead_ends.at(room_index % $dead_ends.size());
return true;
} else {
dbc::log("fucking fuckng fuck fuck");
dbc::check(room_index < $rooms.size(), "room_index is out of bounds, not enough rooms");
Room &start = $rooms.at(room_index);