Removed the variable limit setting since it's never used and instead just have WALL_PATH_LIMIT.

This commit is contained in:
Zed A. Shaw 2024-12-05 08:41:10 -05:00
parent 9abb39a3bf
commit eb0ca38e30
19 changed files with 50 additions and 58 deletions

View file

@ -16,8 +16,7 @@
[1, 0, 1, 1],
[1, 0, 10, 2],
[1, 1, 10, 3]
],
"limit": 10
]
},{
"input": [
[1, 1, 1, 0],
@ -36,6 +35,5 @@
[1, 0, 1, 1],
[1, 0, 16, 2],
[1, 1, 16, 3]
],
"limit": 0
]
}]

View file

@ -19,7 +19,7 @@ TEST_CASE("lighting a map works", "[lighting]") {
LightSource source1{7,1};
LightSource source2{3,2};
LightRender lr(map.width(), map.height(), map.limit());
LightRender lr(map.width(), map.height());
lr.reset_light();

View file

@ -39,7 +39,6 @@ TEST_CASE("dijkstra algo test", "[map]") {
Matrix walls = test["walls"];
Map map(input.size(), input[0].size());
map.$walls = walls;
map.$limit = test["limit"];
map.$paths.$input = input;
REQUIRE(map.INVARIANT());

View file

@ -3,6 +3,7 @@
#include <nlohmann/json.hpp>
#include <fstream>
#include "pathing.hpp"
#include "map.hpp"
using namespace fmt;
using namespace nlohmann;
@ -19,9 +20,8 @@ TEST_CASE("dijkstra algo test", "[pathing]") {
for(auto &test : data) {
Matrix expected = test["expected"];
Matrix walls = test["walls"];
int limit = test["limit"];
Pathing pathing(walls[0].size(), walls.size(), limit);
Pathing pathing(walls[0].size(), walls.size());
pathing.$input = test["input"];
@ -29,6 +29,7 @@ TEST_CASE("dijkstra algo test", "[pathing]") {
pathing.compute_paths(walls);
REQUIRE(pathing.INVARIANT());
REQUIRE(pathing.$paths == expected);
// REQUIRE(pathing.$paths == expected);
}
}

View file

@ -61,7 +61,7 @@ TEST_CASE("can render a text", "[render]") {
world.set<Position>(player.entity, {map.place_entity(0)});
LightRender lights(map.width(), map.height(), map.limit());
LightRender lights(map.width(), map.height());
Canvas map_canvas(map_view.width * 2, map_view.height * 4);