You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
690 B
34 lines
690 B
#include <catch2/catch_test_macros.hpp>
|
|
#include <fmt/core.h>
|
|
#include <nlohmann/json.hpp>
|
|
#include <fstream>
|
|
#include "map.hpp"
|
|
#include "worldbuilder.hpp"
|
|
|
|
using namespace fmt;
|
|
using namespace nlohmann;
|
|
using std::string;
|
|
|
|
TEST_CASE("bsp algo test", "[map]") {
|
|
Map map(20, 20);
|
|
WorldBuilder builder(map);
|
|
builder.generate();
|
|
}
|
|
|
|
TEST_CASE("dumping and debugging", "[map]") {
|
|
Map map(20, 20);
|
|
WorldBuilder builder(map);
|
|
builder.generate();
|
|
|
|
dump_map("GENERATED", map.paths());
|
|
map.dump();
|
|
}
|
|
|
|
TEST_CASE("pathing", "[map]") {
|
|
Map map(20, 20);
|
|
WorldBuilder builder(map);
|
|
builder.generate();
|
|
|
|
REQUIRE(map.can_move({0,0}) == false);
|
|
REQUIRE(map.iswall(0,0) == true);
|
|
}
|
|
|