Initial fix for large center rooms not having entry exit.

This commit is contained in:
Zed A. Shaw 2026-03-07 00:10:42 -05:00
parent da7f24c126
commit 47c0d4a5f0
8 changed files with 130 additions and 85 deletions

View file

@ -18,30 +18,21 @@ TEST_CASE("hunt-and-kill", "[mazes]") {
maze.randomize_rooms();
maze.hunt_and_kill();
maze.dump("ROOM MAZE");
REQUIRE(map.$dead_ends.size() > 0);
REQUIRE(map.$rooms.size() > 0);
for(auto& room : maze.$rooms) {
for(matrix::box it{maze.$walls, room.x, room.y, room.width};
it.next();)
{
maze.$walls[it.y][it.x] = WALL_PATH_LIMIT;
}
}
}
TEST_CASE("hunt-and-kill box", "[mazes]") {
Map map(21, 21);
maze::Builder maze(map);
maze.inner_box(5, 3);
maze.inner_box(5, 4);
maze.hunt_and_kill();
maze.open_box(5, 4);
for(auto at : maze.$dead_ends) {
maze.$walls[at.y][at.x]=32;
}
// maze.dump("INNER BOX");
maze.dump("INNER BOX");
REQUIRE(maze.$rooms.size() == 0);
}
@ -53,9 +44,6 @@ TEST_CASE("hunt-and-kill ring", "[mazes]") {
maze.inner_donut(5.5, 3.5);
maze.hunt_and_kill();
for(auto at : maze.$dead_ends) {
maze.$walls[at.y][at.x]=32;
}
// maze.dump("INNER RING");
REQUIRE(maze.$rooms.size() == 0);
@ -68,9 +56,6 @@ TEST_CASE("hunt-and-kill fissure", "[mazes]") {
maze.divide({3,3}, {19,18});
maze.hunt_and_kill();
for(auto at : maze.$dead_ends) {
maze.$walls[at.y][at.x]=32;
}
// maze.dump("FISSURE MAZE");
REQUIRE(maze.$rooms.size() == 0);
@ -83,8 +68,8 @@ TEST_CASE("hunt-and-kill no-dead-ends", "[mazes]") {
maze::Builder maze(map);
maze.hunt_and_kill();
maze.remove_dead_ends();
maze.enclose();
// maze.dump("NO DEAD ENDS");
}