The next little game in the series where I make a fancy rogue game.
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.
 
 
 
 
 
 
roguish/tests/tilemap.cpp

25 lines
591 B

#include <catch2/catch_test_macros.hpp>
#include <fmt/core.h>
#include "map.hpp"
#include "worldbuilder.hpp"
#include "tilemap.hpp"
#include "config.hpp"
#include "rand.hpp"
using namespace fmt;
using std::string;
TEST_CASE("tilemap can load tiles and make a map", "[tilemap]") {
size_t width = Random::uniform<size_t>(10, 25);
size_t height = Random::uniform<size_t>(10, 33);
Map map(width,height);
WorldBuilder builder(map);
builder.generate();
TileMap tiles(width, height);
auto& walls = map.walls();
tiles.load(walls);
tiles.dump();
REQUIRE(tiles.INVARIANT());
}